First we need to load/run the application in remote debug mode:
Bytes -------------------------------------------------------------------------------------------------------------------
For a normal Java application loading & running (set a command line script for loading ):
------------------
Set CP = D:/work/reversetest/testclass/bin
Java-CP %-agentlib: jdwp = transport = dt_socket, address = localhost: 8888, Server = Y, suspend = y testclass
------------------
Or config like following:
------------------
Set CP = D:/work/reversetest/testclass/bin
Java-CP %-xdebug-xrunjdwp: Transport = dt_socket, Server = Y, address = localhost: 8888 testclass
------------------
For a tomcat or JBoss, WebLogic Server, please set the following options in its loading shell script.
JBoss:
Change run. BAT/run. Sh under jboss_home/bin (add the red line as following ):
Jboss_home:/var/jboss4
Java:/usr/Java/j2sdk1.4.2 _ 06/bin/Java
Java_opts:-server-xms128m-xmx128m-dprogram. Name = run. Sh
Debug_opts =-xdebug-xrunjdwp: Transport = dt_socket, address = localhost: 8888, Server = Y, suspend = N
Classpath:/var/jboss4/bin/run. jar:/usr/Java/j2sdk1.4.2 _ 06/lib/tools. Jar
Tomcat:
Change Catalina. BAT/Catalina. Sh under tomcat_home/bin. (add the red line as following)
Debug_opts =-xdebug-xrunjdwp: Transport = dt_socket, address = localhost: 8888, Server = Y, suspend = N
Second we need to config our eclipse tool to do the remote debug operation:
Bytes -------------------------------------------------------------------------------------------------------------------
1. Create a project by using the existed source code:
2. Click on the project (right mouse), select "Debug as"-> "Debug deployments... ".
3. On the "Debug events" page, click right mouse on the "remote Java application"-> "new ".
4. Fill the configuration page like the following, then click "Apply", set "breakpoints" and then start debug process by clicking "debug ".
5. On the running page, you can see the following screen.