# 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 <java start parameter(s)>
#
# 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 <java start parameter(s)>
#
#
# Start the Java debugger (host: hostname of the machine where the JVM is running)
jdb -connect com.sun.jdi.SocketAttach:hostname=${host},port=${port}
Comments