Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remote debug javaagent jar file

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

like image 882
Anish Antony Avatar asked Nov 07 '13 11:11

Anish Antony


People also ask

How do I remotely debug a Java program?

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.

How do I debug a class in a JAR file?

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.


1 Answers

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
like image 99
Sairam Cherupally Avatar answered Sep 23 '22 02:09

Sairam Cherupally