venerdì 3 settembre 2010

The magic Java Remote Debug string

When you have to debug an application with your prefered editor (like Eclipse :)), you can launch the java application with this string, don't worry if it is in local host or remote host:

 java ... -Xrunjdwp:transport=dt_socket,address=20118,server=y,suspend=n ...

and connect to server for debugging on port specified in address parameter.

The transport parameter specify what type of communication you are using to connect to the server, if you specify dt_socket, you have to set the server parameter to y. The JVM will stay listening on all network interface of server.

The last parameter (suspend) tell to the JVM if it have to wait the first connection from your IDE before start (y) or not (n).

1 commento:

Anonimo ha detto...

I mostly use eclipse for remote debugging . its very easy to setup and its very useful for troubleshooting production issues on large enterprise application, specially if your application is live and you don't have proper development environment setup in your Dev box.