找到startup.bat文件中java
call "%EXECUTABLE%" start %CMD_LINE_ARGS%tomcat
將其修改成以下socket
call "%EXECUTABLE%" jpda start %CMD_LINE_ARGS%spa
默認將啓用8000調試端口,tomcat啓動時debug
其參數修改有三種方式調試
startup.bat 文件修改爲以下server
set JPDA_TRANSPORT=dt_socket
set JPDA_ADDRESS=55001
set JPDA_SUSPEND=n
call "%EXECUTABLE%" jpda start %CMD_LINE_ARGS%get
catalina.bat中「setlocal」上面加入bug
set JPDA_OPTS=-agentlib:jdwp=transport=dt_socket,address=55002,suspend=n,server=y
startup.bat文件改成im
call "%EXECUTABLE%" jpda start %CMD_LINE_ARGS%
catalina.bat中「setlocal」上面加入
SET CATALINA_OPTS=-server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8899
startup.bat保持不變
call "%EXECUTABLE%" start %CMD_LINE_ARGS%
上圖中只須要修改步驟三:將端口改成tomcat的調試端口。
"debug"運行,正常執行結果以下
Connected to the target VM, address: '192.168.156.253:8000', transport: 'socket'