chenhailong 2015-05-18
方法1、
WIN系统,在catalina.bat里:
SETCATALINA_OPTS=-server-Xdebug-Xnoagent-Djava.compiler=NONE-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8899
Linux系统,在catalina.sh里:
CATALINA_OPTS="-server-Xdebug-Xnoagent-Djava.compiler=NONE-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8899"
方法2、
Win系统
在tomcat目录下的bin目录中新建debug.bat,编辑内容如下
setJPDA_ADDRESS=8000
setJPAD_TRANSPORT=dt_socket
SETCATALINA_OPTS=-server-Xdebug-Xnoagent-Djava.compiler=NONE-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8899
startup
双击debug.bat
Linux系统
startup.sh中的最后一行exec"$PRGDIR"/"$EXEXUTABLE"start"$@"中的start修改成
jpdastart,默认的调试端口是8000,可以在catalina.sh文件中设置JPDA_APPDESS=8000
使用startup.sh或者catalina.shjpdastart启动tomcat