0

I am trying to setup my JavaFX enviroment so I referenced the corresponding Jars. In order to run the code I need to use some VM Arguments ("vmArgs": " --module-path /Users/adrif/Downloads/javafx-sdk-14.0.2.1/lib --add-modules javafx.controls,javafx.fxml") in the launch.json. I am working in a multi-project folder so every time a make a new one I have to go to the launch.json and add the arguments. How do I set global arguments? I found adding arguments in "launch" at user settings.json (Launch - Global debug launch configuration. Should be used as an alternative to 'launch.json' that is shared across workspaces) but doesn't work as I expected.

javafx

As you can see, I have two JavaFX projects under the package JavaFX.

tree

And every time I run a new project I have to add the vmArg line to each project.

launch

This is the "launch" options but as I said, it doesn't work or there's someting wrong with how I'm trying to do it. So as the title sais, how to I set global arguments?

Edit : I found the "java.jdt.ls.vmargs" option which allows to specify extre VM Arguments. I does not work either. enter image description here


Solved, turns out it was fixed in newer versions of Vscode and it's pertinent Java Extensions. The workaround that I used was just adding a new set of arguments for every file in the project.

tree

  • no screenshots of text please, they are unreadable .. and stick to java naming conventions! – kleopatra Aug 24 '20 at 09:19
  • ohh .. just seeing that this is a repost of your previous question (which you deleted) https://stackoverflow.com/q/63549812/203657 - don't! Instead, edit the old with relevant details - in your case: details which explain why __exactly__ it's not a duplicate of https://stackoverflow.com/questions/54349894/javafx-11-with-vscode – kleopatra Aug 24 '20 at 09:32
  • The question I deleted has nothing to do with this. – Adrián Núñez Martínez Aug 24 '20 at 13:06
  • This answer has a section about the VM arguments at the bottom. https://stackoverflow.com/a/54353065/2067492 – matt Aug 26 '20 at 08:00
  • Does this answer your question? [JavaFX-11 with VSCode](https://stackoverflow.com/questions/54349894/javafx-11-with-vscode) – matt Aug 26 '20 at 08:00

1 Answers1

2

"vmArgs" was JVM related, "java.jdt.ls.vmargs" was java language server related, the language server was contained in the "Language Support for Java(TM) by Red Hat" extension, so it will not work.

The "launch" configuration in settings.json I tried in local and does not work too.

VSCode has not provided this feature for the present, You need to configure the "vmArgs" for each project. This is because the launch.json file contains different language debugging settings, and lots of configuration was exclusive to some language.

Steven-MSFT
  • 7,438
  • 1
  • 5
  • 13