Remote debugging with Java Virtual Machine

In order to remote debug a JVM export the following java options:

export JAVA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=8888,server=y,suspend=n -XX:MaxPermSize=1024m"

I got this information from this site http://ztiromoritz.wordpress.com/2009/08/03/java-remote-debugging/.

After exporting these java options in the shell where you start the jvm you like to debug, you can use your favorite IDE to connect to port 8888 at localhost in order to start debugging.