Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while verifying JDK #7978

Open
yaskor opened this issue Nov 21, 2024 · 0 comments
Open

Error while verifying JDK #7978

yaskor opened this issue Nov 21, 2024 · 0 comments
Labels
kind:bug Bug report or fix needs:triage Requires attention from one of the committers VSCode Extension [ci] enable VSCode Extension tests

Comments

@yaskor
Copy link

yaskor commented Nov 21, 2024

Apache NetBeans version

Apache NetBeans 23

What happened

Issue: Error displayed incorrectly when verifying the JDK version

The issue occurs when the file path to the JDK contains spaces. For example, in my case:
c:\Program Files\Eclipse Adoptium\jdk-21.0.5.11-hotspot\bin\java

Cause is in
netbeans/java/java.lsp.server/vscode/src/extension.ts
The error can be resolved by modifying the function that calls findJDK to add quotation marks around javaExecPath:

let javaCheck = spawnSync(${javaExecPath} -version, { shell: true });

// Change to:
let javaCheck = spawnSync("${javaExecPath}" -version, { shell: true });

Language / Project Type / NetBeans Component

VS-Code Extension

How to reproduce

Start Netbeans-VS-Code Plugin in VS-Code
Configure JDK
The issue occurs when the file path to the JDK contains spaces. For example, in my case:

Did this work correctly in an earlier version?

No / Don't know

Operating System

Windows 11 x64

JDK

JDK 21

Apache NetBeans packaging

Apache VSNetBeans for VSCode

Anything else

No response

Are you willing to submit a pull request?

Yes

@yaskor yaskor added kind:bug Bug report or fix needs:triage Requires attention from one of the committers labels Nov 21, 2024
@mbien mbien added the VSCode Extension [ci] enable VSCode Extension tests label Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug Bug report or fix needs:triage Requires attention from one of the committers VSCode Extension [ci] enable VSCode Extension tests
Projects
None yet
Development

No branches or pull requests

2 participants