I’ve been trying to set up on JavaFX in VSCode. I added the JavaFX jar files to the referenced libraries and added the following statement to launch.json
(obviously with my path to the lib folder):
"vmArgs": "--module-path "C:/path/to/javafx-sdk-19/lib" --add-modules javafx.controls,javafx.fxml"
This is exactly what multiple youtube videos and other StackOverflow posts have said to do, but I still keep getting this error.
(I know that I can use Maven or Gradle in VScode but am completely unfamiliar with both and still want to try to make this work.)
Hopefully I didn’t miss anything painfully obvious but thank you for any help.
2
Answers
The error can be fixed.
I suggest you learn how to use Maven or Gradle in vscode. It is very important.
At runtime, your app needs access to the JavaFX (OpenJFX) libraries.
Either:
I know of two such implementations of Java (JDKs) that include necessary libraries:
You may have identified a third approach with the use of passing arguments to the JVM. But I am not familiar with that solution.