Java Remote Debug

A former colleague left me a voice mail asking for help in setting up a remote debugging for a running Java process. She is now a director at a small security startup. I thought that if this was helpful for her, it might be useful for other peeps. What follows is basically the instructions I sent her via an email.

To be able to attach your Eclipse debugger to a running Java process you need to start that process with the following Java options…

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

Once you have done this and have restarted the server, you can use your Eclipse to attach to the running process. From Eclipse go to the Debug manager and create a new Remote Java Application configuration for the process you want to connect to. Set the port number to 8001, the same as that of the options. You will also need to enter the hostname for the machine running the Java process. That is pretty much it…

Technorati Tags: , , , , ,