windows环境
写一个 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
第二种
直接把这段配置复制到catalina.bat最上面
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
springboot远程调试参数
java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=7005 -jar ******.jar
参考
参考springboot