1. Environment
Eclipse Luna on Windows 7 64-bit
Tomcat 7 on Linux 64-bit
2. Add setenv.sh under Tomcat's bin directory
File parent folder: tomcat's bin directory
File name: setenv.sh
File content:
export JPDA_OPTS="-agentlib:jdwp=transport=dt_socket,address=1043,server=y,suspend=n"note that don't leave space in "".
$CATALINA_HOME/bin/catalina.sh jpda start4. Eclipse Debug Setting
connection type -> Standard (Socket Attach)
Host -> Tomcat server's IP
Port -> 1043
Allow termination of remote VM -> true
Reference:
[1] http://blog.trifork.com/2014/07/14/how-to-remotely-debug-application-running-on-tomcat-from-within-intellij-idea/