Run/Debug Maven JavaFX 2 in Netbeans

2019-07-12 18:15发布

I setup a Maven project for a JavaFX 2 application, which uses javafxpackager threw exec-maven-plugin to build a runnable jar. This build process works fine and the application can be started from the commandline.

Does anyone know how to modify nbactions to run and debug this jar from within the IDE?

The command to execute the jar on the commandline is:

java -Djavafx.runtime.path=$JAVAFX_HOME/rt -jar ./target/MyApp.jar

1条回答
虎瘦雄心在
2楼-- · 2019-07-12 18:36

The modification it's, for every "action" tag, change the tag as follows:

 <exec.args>-classpath %classpath  -Xbootclasspath/a:"C:/Program Files/Oracle/JavaFX 2.2 SDK/rt/lib/jfxrt.jar"  ${packageClassName}</exec.args>

Of course, change "C:/Program..." to fit your setup.

查看更多
登录 后发表回答