Skip to content

Commit 074c098

Browse files
update java_path with java_home
1 parent 04f4b0d commit 074c098

File tree

9 files changed

+27
-25
lines changed

9 files changed

+27
-25
lines changed

.github/workflows/java-tests.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
# TODO: this direct path loading is not maintainable. Our build system should define and
7676
# support test classes.
7777
run: |
78-
$JAVA_PATH/bin/java \
78+
$JAVA_HOME/bin/java \
7979
-cp 'third_party/java_deps/artifacts/*:out/linux-x64-tests/lib/src/controller/java/*' \
8080
org.junit.runner.JUnitCore \
8181
matter.tlv.TlvWriterTest \

build/chip/java/config.gni

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
java_path = getenv("JAVA_PATH")
15+
java_home = getenv("JAVA_HOME")
1616
declare_args() {
1717
java_matter_controller_dependent_paths = []
1818

@@ -24,15 +24,15 @@ declare_args() {
2424
matter_enable_tlv_decoder_api = true
2525

2626
matter_enable_java_compilation = false
27-
if (java_path != "" && (current_os == "linux" || current_os == "mac")) {
28-
java_matter_controller_dependent_paths += [ "${java_path}/include/" ]
27+
if (java_home != "" && (current_os == "linux" || current_os == "mac")) {
28+
java_matter_controller_dependent_paths += [ "${java_home}/include/" ]
2929

3030
if (current_os == "mac") {
3131
java_matter_controller_dependent_paths +=
32-
[ "${java_path}/include/darwin/" ]
32+
[ "${java_home}/include/darwin/" ]
3333
} else {
3434
java_matter_controller_dependent_paths +=
35-
[ "${java_path}/include/linux/" ]
35+
[ "${java_home}/include/linux/" ]
3636
}
3737

3838
matter_enable_java_generated_api = false

build/chip/java/jar_runner.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ def FindCommand(command):
7979

8080

8181
def main():
82-
java_path = FindCommand('jar')
83-
if not java_path:
82+
java_home = FindCommand('jar')
83+
if not java_home:
8484
sys.stderr.write('jar: command not found\n')
8585
sys.exit(EXIT_FAILURE)
8686

@@ -89,7 +89,7 @@ def main():
8989
sys.stderr.write('usage: %s [jar_args]...\n' % sys.argv[0])
9090
sys.exit(EXIT_FAILURE)
9191

92-
return subprocess.check_call([java_path] + args)
92+
return subprocess.check_call([java_home] + args)
9393

9494

9595
if __name__ == '__main__':

build/chip/java/javac_runner.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ def ComputeClasspath(build_config_json):
9393

9494

9595
def main():
96-
java_path = FindCommand('javac')
97-
if not java_path:
96+
java_home = FindCommand('javac')
97+
if not java_home:
9898
sys.stderr.write('javac: command not found\n')
9999
sys.exit(EXIT_FAILURE)
100100

@@ -123,7 +123,7 @@ def main():
123123

124124
build_config_json = ReadBuildConfig(args.build_config)
125125
classpath = ComputeClasspath(build_config_json)
126-
java_args = [java_path]
126+
java_args = [java_home]
127127
if classpath:
128128
java_args += ["-classpath", classpath]
129129

build/chip/java/rules.gni

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jar_runner = "${chip_root}/build/chip/java/jar_runner.py"
2222
write_build_config = "${chip_root}/build/chip/java/write_build_config.py"
2323

2424
assert(android_sdk_root != "" || matter_enable_java_compilation,
25-
"android_sdk_root must be specified or JAVA_PATH must be set.")
25+
"android_sdk_root must be specified or JAVA_HOME must be set.")
2626

2727
# Declare a java library target
2828
#

examples/java-matter-controller/README.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ cluster requests to a Matter device
77

88
<hr>
99

10-
- [Matter Controller Java App Example](#matter-controller-java-app-example)
11-
- [Requirements for building](#requirements-for-building)
12-
- [Preparing for build](#preparing-for-build)
13-
- [Building & Running the app](#building--running-the-app)
10+
- [Matter Controller Java App Example](#matter-controller-java-app-example)
11+
- [Requirements for building](#requirements-for-building)
12+
- [Linux](#linux)
13+
- [Preparing for build](#preparing-for-build)
14+
- [Building \& Running the app](#building--running-the-app)
1415

1516
<hr>
1617

@@ -95,7 +96,7 @@ export PATH="/usr/lib/kotlinc/bin:$PATH"
9596
### Linux
9697

9798
```shell
98-
export JAVA_PATH=[JDK path]
99+
export JAVA_HOME=[JDK path]
99100
```
100101

101102
<hr>

examples/kotlin-matter-controller/README.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ control Matter accessory devices.
55

66
<hr>
77

8-
- [Matter Controller Kotlin App Example](#matter-controller-kotlin-app-example)
9-
- [Requirements for building](#requirements-for-building)
10-
- [Preparing for build](#preparing-for-build)
11-
- [Building & Running the app](#building--running-the-app)
8+
- [Matter Controller Kotlin App Example](#matter-controller-kotlin-app-example)
9+
- [Requirements for building](#requirements-for-building)
10+
- [Linux](#linux)
11+
- [Preparing for build](#preparing-for-build)
12+
- [Building \& Running the app](#building--running-the-app)
1213

1314
<hr>
1415

@@ -82,7 +83,7 @@ export PATH="/usr/lib/kotlinc/bin:$PATH"
8283
### Linux
8384

8485
```shell
85-
export JAVA_PATH=[JDK path]
86+
export JAVA_HOME=[JDK path]
8687
```
8788

8889
<hr>

scripts/build/builders/host.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ def SysRootPath(self, name):
556556

557557
def generate(self):
558558
super(HostBuilder, self).generate()
559-
if 'JAVA_PATH' in os.environ:
559+
if 'JAVA_HOME' in os.environ:
560560
self._Execute(
561561
["third_party/java_deps/set_up_java_deps.sh"],
562562
title="Setting up Java deps",

scripts/build/test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def build_actual_output(root: str, out: str, args: List[str]) -> List[str]:
4747
'NXP_K32W0_SDK_ROOT': 'TEST_NXP_K32W0_SDK_ROOT',
4848
'IMX_SDK_ROOT': 'IMX_SDK_ROOT',
4949
'TI_SYSCONFIG_ROOT': 'TEST_TI_SYSCONFIG_ROOT',
50-
'JAVA_PATH': 'TEST_JAVA_PATH',
50+
'JAVA_HOME': 'TEST_JAVA_HOME',
5151
'GSDK_ROOT': 'TEST_GSDK_ROOT',
5252
'WISECONNECT_SDK_ROOT': 'TEST_WISECONNECT_SDK_ROOT',
5353
'WIFI_SDK_ROOT': 'TEST_WIFI_SDK_ROOT',

0 commit comments

Comments
 (0)