From 522b56b21016c42e650a2620bebaa1b39e5e0f4e Mon Sep 17 00:00:00 2001 From: Tang Tang Zhou Date: Wed, 21 Feb 2024 19:06:31 +0100 Subject: [PATCH] Fix python script to retrieve JAVA_HOME exec in Windows OS Signed-off-by: Tang Tang Zhou --- org.eclipse.jdt.ls.product/scripts/jdtls.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/org.eclipse.jdt.ls.product/scripts/jdtls.py b/org.eclipse.jdt.ls.product/scripts/jdtls.py index d1920d1b3a..09b9aa90bb 100644 --- a/org.eclipse.jdt.ls.product/scripts/jdtls.py +++ b/org.eclipse.jdt.ls.product/scripts/jdtls.py @@ -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()