What are Java command line options to set to allow JVM to be remotely debugged?

debugging, java

Solution

I have this article bookmarked on setting this up for Java 5 and below.

Basically run it with:

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

For Java 5 and above, run it with:

-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044

If you want Java to wait for you to connect before executing the application, replace `suspend=n` with `suspend=y`.

Problem

I know there's some `JAVA_OPTS` to set to remotely debug a Java program. What are they and what do they mean ?

Original source