diff --git a/java/java.lsp.server/vscode/src/extension.ts b/java/java.lsp.server/vscode/src/extension.ts index 621ac95829ea..7173ea8d5464 100644 --- a/java/java.lsp.server/vscode/src/extension.ts +++ b/java/java.lsp.server/vscode/src/extension.ts @@ -479,7 +479,7 @@ export function activate(context: ExtensionContext): VSNetBeansAPI { if (jdkOK) { log.appendLine(`Verifying java: ${javaExecPath}`); // let the shell interpret PATH and .exe extension - let javaCheck = spawnSync(`${javaExecPath} -version`, { shell : true }); + let javaCheck = spawnSync(`"${javaExecPath}" -version`, { shell : true }); if (javaCheck.error || javaCheck.status) { jdkOK = false; } else {