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

VSCode Extension - JDK Path with Spaces not working #572

Open
ninelore opened this issue Apr 30, 2024 · 1 comment
Open

VSCode Extension - JDK Path with Spaces not working #572

ninelore opened this issue Apr 30, 2024 · 1 comment
Assignees
Labels

Comments

@ninelore
Copy link

ninelore commented Apr 30, 2024

Describe the bug
The JDK Path, no matter if detected or explicitly set, doesnt seem to work correctly. Ive also tried with and without surrounding quotation marks.

To Reproduce
Steps to reproduce the behavior:

  1. Have JDK in a Path with spaces (e.g. C:\Program FIles)
  2. try to start VisualVM from the VSCode extension (the "play" icon)
  3. If yes is pressed:
  • if jdkpath is set in visualvm.conf VisualVM will start and instantly crash. (it will start normally if started independently via the exe)
  • if its not set it will error with jdk not found

Expected behavior
VisualVM starting without error

VisualVM log
n/a

Screenshots
image

Desktop (please complete the following information):

  • OS: Win 11
  • JDK version: Eclipse Adoptium 21.0.3.9-hotspot

Additional context
n/a

LMK if i missed to provide any other info. thanks

@ninelore ninelore added the bug label Apr 30, 2024
@jisedlac jisedlac self-assigned this May 3, 2024
@jisedlac
Copy link
Member

jisedlac commented May 3, 2024

Thank you for the report! I was able to reproduce the problem. Obviously caused by trying to run VisualVM using Java installed in a path containing spaces.

By default, the extension always starts VisualVM with the --jdkhome parameter. This means that even if the visualvm_jdkhome property is defined correctly in visualvm.conf, and VisualVM runs fine when started externally using .exe, it fails to start from within the VS Code.

Until fixed, the workaround is to unselect the Settings | Extensions | VisualVM | Use JDK Path for VisualVM option, or manually add "visualvm.startup.useJdkPathForVisualvm": false to settings.json. This will allow VisualVM to run using the JDK defined in visualvm.conf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants