You may have debugged standalone Java applications from Eclipse. You set breakpoints in the code, run the application in the Debug
mode from Eclipse, and then debug the application by stepping through the code. Debugging remote Java applications is a bit different, particularly when it comes to how you launch the debugger. In the case of local application, the debugger launches the application. In the case of remote application, it is already launched and you need to connect the debugger to it. In general, if you want to allow remote debugging for the application, you need to run the application using the following parameters:
-Xdebug -Xrunjdwp:transport=dt_socket,address=9001,server=y,suspend=n
Instead of -Xdebug -Xrunjdwp
, you can also use -agentlib:jdwp
for JDK 1.5 and above, for example:
-agentlib:jdwp=transport= dt_socket,address=9001,server=y,suspend...