tags:

views:

2391

answers:

3

I know there's some JAVA_OPTS to set to remotely debug a Java program.

What are them and what does they mean ?

+11  A: 

I have this article bookmarked on setting this up with Eclipse.

Basically run it with:

-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1044
Hans Sjunnesson
+3  A: 

Here's some more gory details on what the options are:

http://java.sun.com/javase/6/docs/technotes/guides/jpda/conninv.html

Alex Miller
+3  A: 

Ok, by the way, -Xdebug and -Xrunjdwp arguments are to use for Java prior 5.0.

For Java 5.0 and after, it's preferable to use the -agentlib:jdwp single option.

So to summarize :

  • before Java 5.0, use -Xdebug and -Xrunjdwp arguments
  • from Java 5.0, use agentlib:jdwp

Options on -Xrunjdwp or agentlib:jdwp arguments are :

  • transport=dt_socket : means the way used to connect to JVM (socket is a good choice, it can be used to debug a distant computer)
  • address=8000 : TCP/IP port exposed, to connect from the debugger,
  • suspend=y : if 'y', tell the JVM to wait until debugger is attached to begin execution, otherwise (if 'n'), starts execution right away.
paulgreg