javafx-maven-plugin
javafx-maven-plugin copied to clipboard
Unable to Debug
Intellij skips my break points when trying to debug my application.
I believe its the same issue as this (unresolved) issue https://github.com/javafx-maven-plugin/javafx-maven-plugin/issues/318
I want to rise this problem too
Me too. I'm also interested how to setup this in NetBeans.
I found a solution here: https://stackoverflow.com/questions/56197372/i-cant-debug-an-application-using-netbeans-11-with-javafx-12/56207033#56207033. it only contains a netbeans solution, but you can also do this for Intellij.
To do it in intellij I added a new maven build with the debug config. Then i added an remote configuration with the setting from the stackoverflow Then i added a compound execution to run them both at the same time.
I hope this helps for you guys @imlige and @draganbjedov
@Lehcim1995 I'm currently trying to get this to work in IntelliJ. For me it only works as two separate run configs, which I must run one after the other by hand. Could you maybe share how you got it working?
Yes, you need to run 2 different configurations, one for the application and one for the debugger that connects to it. (Intellij does this on the background for normal Java).
As I said in my previous comment, you will need to add a compound (https://www.jetbrains.com/help/idea/creating-compound-run-debug-configuration.html) configuration with both of your configs in it. then you can call that config to start and stop debugging.
With NetBeans IDE 16 and javafx-maven-plugin 0.0.8, the Run and Debug action button works fine after I import my Maven project.
button action: Run project Execute Goals: clean javafx:run
button action: Debug project Execute Goals: clean javafx:run@ide-debug Set Properties: jpda.listen=true
pom.xml
...
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.8</version>
<configuration>
<mainClass>${mainClass}</mainClass>
<stripDebug>false</stripDebug>
<compress>2</compress>
<noHeaderFiles>true</noHeaderFiles>
<noManPages>true</noManPages>
<launcher>hellofx</launcher>
<jlinkImageName>hello</jlinkImageName>
<jlinkZipName>hellozip</jlinkZipName>
</configuration>
<executions>
<execution>
<!-- Default configuration for running -->
<!-- Usage: mvn clean javafx:run -->
<id>default-cli</id>
</execution>
<execution>
<!-- Configuration for manual attach debugging -->
<!-- Usage: mvn clean javafx:run@debug -->
<id>debug</id>
<configuration>
<options>
<option>-agentlib:jdwp=transport=dt_socket,server=n,suspend=y</option>
</options>
</configuration>
</execution>
<execution>
<!-- Configuration for automatic IDE debugging-->
<id>ide-debug</id>
<configuration>
<options>
<option>-agentlib:jdwp=transport=dt_socket,server=n,suspend=n,address=${jpda.address}</option>
</options>
</configuration>
</execution>
<execution>
<!-- Configuration for automatic IDE profiling -->
<id>ide-profile</id>
<configuration>
<options>
<option>${profiler.jvmargs.arg1}</option>
<option>${profiler.jvmargs.arg2}</option>
<option>${profiler.jvmargs.arg3}</option>
<option>${profiler.jvmargs.arg4}</option>
<option>${profiler.jvmargs.arg5}</option>
</options>
</configuration>
</execution>
</executions>
</plugin>
...
Can someone please send me similar settings for debugging in Intellij IDEA?
Lehcim1995
This doesn't work for me at all, because the execution order of the two separate run configurations within a Compound configuration isn't guaranteed (they run in parallel), but I need to ensure that the JavaFX app launches before the remote JVM debug configuration. So, I'm wondering how you managed to accomplish this? Currently, I manually run the Maven debug configuration first and then the remote JVM debug configuration.
@Lehcim1995 I'm currently trying to get this to work in IntelliJ. For me it only works as two separate run configs, which I must run one after the other by hand. Could you maybe share how you got it working?
I have the same problem.