javafx-maven-plugin icon indicating copy to clipboard operation
javafx-maven-plugin copied to clipboard

Unable to Debug

Open Lehcim1995 opened this issue 5 years ago • 8 comments

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

Lehcim1995 avatar Dec 11 '19 14:12 Lehcim1995

I want to rise this problem too

imlige avatar Dec 15 '19 12:12 imlige

Me too. I'm also interested how to setup this in NetBeans.

draganbjedov avatar Dec 20 '19 12:12 draganbjedov

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 avatar Jan 10 '20 13:01 Lehcim1995

@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?

DerMolly avatar Apr 06 '20 21:04 DerMolly

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.

Lehcim1995 avatar Apr 06 '20 22:04 Lehcim1995

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?

buedi avatar Feb 23 '23 15:02 buedi

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.

DawidLokiec avatar Mar 03 '24 17:03 DawidLokiec

@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.

DawidLokiec avatar Mar 03 '24 17:03 DawidLokiec