Tuesday, May 17, 2011

Setup remote debugging in Eclipse

Debugging is always an interesting way to understand better how a system works internally.

And will happen with most of opensource projects.

So how can we easily debug ? The answer is : use remote debugging.

To be able to attach your Eclipse debugger to a running Java process you need to start that process with the following Java options…It can be any of your startup files for the application.. may be run.sh..etc

export JAVA_OPTS=

"-Xdebug -Xrunjdwp:transport=dt_socket,address=9000,server=y,suspend=n"

Once you have done this restart the server.

From Eclipse go to the Debug Configuration.






create a new Remote Java Application configuration for the process you want to connect to and set the port number to xxxx(eg - 9000), the same as that of the options.





Enter the hostname for the machine running the Java process. Thats it…you are on debug mode...

No comments:

Post a Comment