Java remote debugging

There are a lot of articles in the web about remote debugging in Java, but it’s necessary to point out one thing. The JVM parameters that you have to set depends on the Java version:

    • before Java 5, use:
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1044
    • from Java 5, use:
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044

For both, the parameters mean:

  • transport: name of the transport to be used when debugging the application (dt_socket for a socket connection)
  • server: “y” if the application listens for a connection at the specified address. “n” if the application attempts to attach to a debugger at the specified address
  • suspend: “n” if the application starts immediately. “y” if the application waits until a debugger has attached to it before executing
  • address: specifies a port number used for communication between the debugger and application

Source: http://docs.oracle.com/javase/1.5.0/docs/guide/jpda/conninv.html#Invocation

0 Responses to “Java remote debugging”



  1. Leave a Comment

Leave a comment




Enhanced Links