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()