I want to run a HelloWorld JavaFX 11 application using Maven from IntelliJ IDEA using a run/debug configuration to be able to debug the application.
I've created a Maven project in IntelliJ IDEA with pom.xml and HelloFX.java.
I can build the project successfully and run it executing the specified compile
and exec:java
goals.
But when I run it using a run/debug configuration with VM options --add-modules=javafx.controls
, I get:
Error occurred during initialization of boot layer
java.lang.module.FindException: Module javafx.controls not found
The only way I've managed to run it is by downloading a JavaFX runtime and setting VM options to --module-path /path/to/javafx-sdk-11/lib --add-modules=javafx.controls
.
But is there any way to run it using artifacts downloaded from Maven? As I've thought that IntelliJ IDEA can use Maven artifacts in runtime. Or am I just getting something wrong?
P.S. I am aware about this answer, but it doesn't describe what I want to do.
exec:java
goal (Maven Projects window, right click -> Debug [exec:java]), works for me, without adding the SDK. – CompteApplication
doesn't work (the configuration type you've suggested isMaven
)? It has always worked for my previous Maven projects. – Unstop