Remote Debugging Tomcat Web Applications

Modify the Tomcat startup file (startup.sh/startup.bat) and prepend the following lines right before the last line:

JPDA_TRANSPORT="dt_socket"
JPDA_ADDRESS="_YOUR_CUSTOM_PORT_HERE_"
JPDA_SUSPEND="n"
JPDA_OPTS="-agentlib:jdwp=transport=$JPDA_TRANSPORT,address=$JPDA_ADDRESS,server=y,suspend=$JPDA_SUSPEND"
CATALINA_OPTS="$CATALINA_OPTS $JPDA_OPTS"

Finally modify the last line to:

exec "$PRGDIR"/"$EXECUTABLE" jpda start "$@"

https://www.jvmhost.com/articles/debugging-with-jpda-and-apache-tomcat/

Last updated