Debug with Eclipse and Tomcat

Run Tomcat in debug mode

./catalina.sh jpda start

# or (interactive mode)
./catalina.sh jpda run

Create new debug configuration in Eclipse

  • set breakpoint(s)
  • Run -> Debug... -> create “Remote Java Application” connecting to port 8000

Debug

  • load a page of your webapp in your browser
  • go back to Eclipse and take control

Note: modifications to the Java code will take effect instantaneously!

Reference

Feedback

You should also set your environment variables JPDA_ADDRESS=8000 and JPDA_TRANSPORT=dt_socket before using ./catalina.sh jpda start.
Ramya K
Jun 14, 2010
#1