Debugging Java programs remotely using Eclipse JPDA
This article describes the use of Eclipse JPDA to debug a remotely running Java program in the Eclipse development environment.
Please follow the steps below (I have successfully debugged in Eclipse 3.2, JDK 1.5_08) environment.
1. When starting the Java program, in the Java startup command, add the following parameters
-xdebug-xrunjdwp:transport=dt_socket,address=1234,server=y,suspend=n
Note: The suspend parameter indicates whether to wait for the JPDA debug side to connect at startup. n indicates no
2. After the configuration, you can run the Java program, see the following prompt, indicating that the debug function has been turned on
Listening for transport dt_socket at address:1234
3. Open Eclipse, in the menu "Run", "Debug ..." Pop-up dialog box, select Remote Java application, new Debug Configuration
* Project is a running program source code project
* Host,port Host: The port where the Java program is running in the IP port set in the Java Run command
4. Complete, run debug directly. Next, the same method is used to debug the local program.
Good luck!
Yours matthew!
Transferred from: http://www.blogjava.net/xmatthew/archive/2009/08/08/290331.html
Eclipse Remote Debug Java program