# set a port number for the remote debugging port=4242 # # Start the JVM and wait for the connection of the debugger java -Xdebug -Xrunjdwp:transport=dt_socket,address=${port},server=y,suspend=y # # Or: start the JVM and don't wait for the connection of the debugger java -Xdebug -Xrunjdwp:transport=dt_socket,address=${port},server=y,suspend=n # # # Start the Java debugger (host: hostname of the machine where the JVM is running) jdb -connect com.sun.jdi.SocketAttach:hostname=${host},port=${port}