Saturday, October 26, 2013

Remote Debugging using Eclipse

   Your java application is running on a remote machine, something goes haywire and the only way to debug your application is through making changes to a piece of code at random and redeploying it multiple time rather than actually stepping through the code??
   Well here is a better solution to that problem. Remote Debugging using Eclipse.

1. Install the Remote System Explorer

2. Establish an ssh connection to the remote server using the Remote System Explorer plugin


3. Start the java application debug server in the remote location(say hostname.company.com) with -Xdebug, -Xrunjdwp VM argument
java -Xdebug -Xrunjdwp:transport=dt_socket,address=8001,server=y,suspend=y -jar

3. Right click on the eclipse project that you would like to hook it to Remote Debugger as in the picture


4. Right click on the Remote Java Application and select 'new'


5. Configure the connection details as shown below


6. Run the debug!
Happy bugging :)
To understand more about how it works.. Head over to
Java Debug Architecture
and
http://docs.oracle.com/javase/1.5.0/docs/guide/jpda/jdwp-spec.html

No comments:

Post a Comment