eclipse 远程调试tomcat6
一、tomcat6配置
1、修改tomcat\bin目录下的startup.bat如下,红色部分是新增的,修改后另存为jpda.bat
set JPDA_ADDRESS=8114
set JPDA_TRANSPORT=dt_socket
set JPDA_SUSPEND=y
call "%EXECUTABLE%" jpda start %CMD_LINE_ARGS%
各变量意义在catalina.bat中有说明:
JPDA_TRANSPORT (Optional) JPDA transport used when the "jpda start"
command is executed. The default is "dt_socket".
JPDA_ADDRESS (Optional) Java runtime options used when the "jpda start"
command is executed. The default is 8000.
JPDA_SUSPEND (Optional) Java runtime options used when the "jpda start"
command is executed. Specifies whether JVM should suspend
execution immediately after startup. Default is "n".
JPDA_OPTS (Optional) Java runtime options used when the "jpda start"
2、运行jpda.bat,tomcat会等待调试器连接
二、Eclipse配置
在Eclipse工具栏上选择Debug->Debug Configurations ...
在弹出对话框中选择Remote Java Application 右键New,选择如下:
点击Debug开始调试