Eclipse Remote Debugging

Eclipse has a powerful debugger, which allow breakpoints, code stepping, variable inspection, expressions, hot code replacement etc. Therefore any application that is run from Eclipse can be debugged.

Even if it is a built and released application running on a separate machine, it can also be debugged remotely from an Eclipse IDE. As this option is built into the JVM, it can work on any kind of Java application; from simple Java applications to web applications to complex Eclipse RCP plugins.

Just add these JVM options to the command that starts the application/web server.

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

When the application is started, it will wait for a debugger to be attached.

From Eclipse, Open the Debug dialog, and create a new “Remote Java Application”. Set the host and port in the “Connection Properties” section to the waiting application. Click “Debug” and watch it go! Set the breakpoints and it can be debugged as if it was locally run.

RSS feed for comments on this post · TrackBack URL

Leave a Comment