以前用到過,補錄下。
catalina.bat中
行rem Guess CATALINA_HOME if not defined后加入:
if ""%1""==""stop"" goto_skip_config
SET CATALINA_OPTS=-server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8787
:skip_config
其中address為遠程debug使用的端口號。eclipse配置如下圖所示:
啟動Tomcat會在第一行打印出debug配置信息。