Skip to content

Commit

Permalink
Fix python script to retrieve JAVA_HOME exec in Windows OS
Browse files Browse the repository at this point in the history
Signed-off-by: Tang Tang Zhou <[email protected]>
  • Loading branch information
tangtang95 authored and rgrunber committed Feb 22, 2024
1 parent 657442b commit 522b56b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion org.eclipse.jdt.ls.product/scripts/jdtls.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ def get_java_executable(validate_java_version):
java_executable = 'java'

if 'JAVA_HOME' in os.environ:
java_exec_to_test = Path(os.environ['JAVA_HOME']) / 'bin' / 'java'
ext = '.exe' if platform.system() == 'Windows' else ''
java_exec_to_test = Path(os.environ['JAVA_HOME']) / 'bin' / f'java{ext}'
if java_exec_to_test.is_file():
java_executable = java_exec_to_test.resolve()

Expand Down

0 comments on commit 522b56b

Please sign in to comment.