Skip to content

Commit d9a5cfd

Browse files
committed
Use JAVA_HOME if set
1 parent 7911a62 commit d9a5cfd

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

distrib/run_kotlin_kernel/run_kernel.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,14 @@ def run_kernel_impl(connection_file: str, jar_args_file: str = None, executables
3939
class_path_arg = os.pathsep.join([os.path.join(jars_dir, jar_name) for jar_name in cp])
4040
main_jar_path = os.path.join(jars_dir, main_jar)
4141

42-
subprocess.call(['java', '-jar'] + debug_list +
42+
java_home = os.getenv("JAVA_HOME")
43+
44+
if java_home is None:
45+
java = "java"
46+
else:
47+
java = os.path.join(java_home, "bin", "java")
48+
49+
subprocess.call([java, '-jar'] + debug_list +
4350
[main_jar_path,
4451
'-classpath=' + class_path_arg,
4552
connection_file,

0 commit comments

Comments
 (0)