Breakpoints does not work after reloading classes

2019-05-27 03:15发布

问题:

I'm running my java application with an "Application" configuration in Intellij and I'm using these vm options for using springloaded: -javaagent:.../springloaded-1.2.0.RELEASE.jar -noverify

The class reloading with springloaded works fine.

But the debugger won't stop any more at the breakpoints in the reloaded classes. Breakpoints in other classes still work.

回答1:

This solution works:

  • start the application in run mode (instead of debug mode) with the remote debug option: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005

  • Start remote debug from intellij.

But perhaps there's a better solution?