tomcat6实现远程调试
安装完tomcat6后,运行tomcat6w.exe,如图,在java options里面添加:
-agentlib:jdwp=transport=dt_socket,server=y,address=8787
还有一种添加参数的方法,如果有catalina.bat,也可以通过修改此文件来添加参数:
在catalina.bat开头加入:
set JPDA_TRANSPORT=dt_socket
set JPDA_ADDRESS=8787
然后把startup.bat靠末尾一行:
call "%EXECUTABLE%" start %CMD_LINE_ARGS%
改成
call "%EXECUTABLE%" jpda start %CMD_LINE_ARGS%
启动tomcat,如果出现下图的界面说明成功了:
Listening for transport dt_socket at address: 8787
tomcat 6.0.35
catalina.bat
SET CATALINA_OPTS=-server -Xms256m -Xmx256m -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n