oracle / visualvm

VisualVM is an All-in-One Java Troubleshooting Tool
https://visualvm.github.io/
Other
2.79k stars 297 forks source link

VSCode Extension - JDK Path with Spaces not working #572

Closed ninelore closed 2 weeks ago

ninelore commented 2 months ago

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

Additional context n/a

LMK if i missed to provide any other info. thanks

jisedlac commented 2 months ago

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.

jisedlac commented 2 weeks ago

Fixed.