I've created a JavaFX Application in IntelliJ for the first time. To that end, I've imported the JavaFX libraries into my project libraries and built a jar from my project. Then I've used Launch4j to wrap it as an executable file with following JVM options:
--module-path /Users/myName/Downloads/javafx-sdk-11.0.2/lib --add-modules javafx.controls,javafx.fxml
On the PC I've created the application it obviously runs smoothly. If I want to use it on another computer, I run into the following exception when I try to launch it:
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
My question is if the application can't be launched due to the path I've given in the JVM options (since this seems very 'local' you could say, I guess) and it tries to add modules from a place that doesn't exist on my other PC? If so, how can I fix it so the exe can be launched on any PC without issues, as in so I don't have to download the lib on any PC. So where should I place the lib of the SDK? Is there any default way to do this, or what's the cleanest way?
And if I'm completely wrong... What else am I missing? Is it a memory problem?
Apologies if this is a dumb question and thanks in advance!