===============Tomcat setting -- enable JPDA debugging================================
>cd %CATALINA_HOME%\bin
>SET CATALINA_OPTS=-server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5888
>catalina start
================Eclipse Setting===================================================
Debug Configuration->Remote Java Application->new
--Connect--
Name: Debug Tomcat
Project: jpetstore (which project is copied to the tomcat)
Host: localhost
Port: 5888
--Source--
all libs and src (此时可以看到程序会停在本机设的断点上,要提醒的是我们程序实际是跑在服务器上的,却能使用本机的断点,挺奇妙的!
)