windows
1.写一个 startup-debug.bat,指定tomcat的根目录,端口自己定义
rem 设置Tomcat目录--
set CATALINE_HOME=D:\asd\A8-2\tomcat
d:
rem 8787为可用端口,为远程调试监听端口--
cd %CATALINE_HOME%/bin
set JPDA_ADDRESS=8787
set JPDA_TRANSPORT=dt_socket
set CATALINA_OPTS=-server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8787
startup
2.或者添加一个setenv.bat文件
set CATALINA_OPTS=-server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8787
Linux
1.写一个startup-debug.sh,指定tomcat的根目录,端口自己定义
declare -x CATALINA_OPTS="-server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8787"
2.或者是在catalina.sh文件中添加一行
CATALINA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=60222,suspend=n,server=y"