maroph icon

Java Remote Debugging

maroph | PRO | 12/21/16 07:40:04 AM UTC | 0 ⭐ | 339 👁️ | Never ⏰ | []
Bash |

550 B

|

None

|

0 👍

/

0 👎

# 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