I created a javaagent jar file and attached it with a web application (by using -javaagent
keyword on the startup of web application). How can i possible to remote debug this javaagent with eclipse
Go to the eclipse menu and select Run->Debug Configuration; it opens Debug Configuration setup. On the Debug configuration window, create a new “Remote Java Application” configuration. Select the project to be debugged and give it a Name. Select connection type, Socket Attach, or Socket Listen.
If you debug a JAR file that does not have the Main-Class attribute, you can use the JAR URL syntax jar:<url>!/{entry} that is specified in the class JarURLConnection of the Java 2 Platform, Standard Edition to specify the name of the main class, as in the following examples.
java agentlib:jdwp=transport=dt_socket,server=y,address=10110,suspend=y
-javaagent:pathTo/myagent.jar -cp pathTo/myApp.jar com.example
In Eclipse, attach the debugger to agent jar by adding the following statement to VM arguments.
agentlib:jdwp=transport=dt_socket,server=y,address=10110,suspend=y
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With