Wednesday, April 8, 2009

Remote Debugging using Eclipse

Set these parameters on the remotely running java process

DEBUG_OPTS="-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,address=8000,suspend=n -Djava.compiler=NONE"

where 8000 is the port on which the java process listens to debug commands from eclipse.

When the java code is compiled ensure that debug is enabled

In the case of ant set

      <javac debug="on" ....> ... </javac>

from Eclipse choose
Run -->
Debug Configurations -->
Select Your Project
Give the IP and the Port of the machine where the remote process is running.
Finally click on Debug

Now you can set break points as usual from eclipse and the window will pop up when the execution reaches that point.

No comments:

Free Domain Names @!