A breakpoint set with IntelliJ, not working primarily with a remote user java agent

I started implementing a simple Java agent that does some tools before the class is loaded by the JVM. The fact is that I need to do some debugging of this agent, but what I tried so far failed (I tried to debug the agent remotely, but it does not work)

I use IntelliJ and Maven (to create the .jar agent).

So my question is: is there a trick for remotely debugging a simple java agent?

+4
source share
1 answer

As it turns out, I have a project that demonstrates the Java tools that I tested with debugging in IntelliJ. Breakpoints work. You can use it as a link.

https://github.com/noahlz/weaver-demo

Example run / debug configuration from IntelliJ

Agent App Run / Debug

In addition, if you are debugging remotely, prefaning can be performed before you can connect to the debugger. Try changing suspend=n to suspend=y in the debug command that you pass to the JVM that runs the agent code. This way, it will wait until you connect to IntelliJ before continuing.

+2
source

All Articles