1.Linxu系统: apach/bin/startup.sh开始处中增长以下内容:java
declare -x CATALINA_OPTS="-server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8788"
2.Windows系统: apach/bin/startup.bat开始处中增长以下内容:linux
SET CATALINA_OPTS=-server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8788
3.linux打开端口命令的使用方法。windows
nc -lp 8788 &(打开8788端口)socket
4.查看是否打开8788端口debug
netstat -an | grep 8788调试
windows下能够经过命令"catalian.bat jpda start" linux则是"./catalian.sh jpda start"。
catalia.sh的区别,bat 里面的默认jpda参数是 JPDA_TRANSPORT (Optional) JPDA transport used when the "jpda start" command is executed. The default is "dt_shmem".code
JPDA_ADDRESS (Optional) Java runtime options used when the "jpda start" command is executed. The default is "jdbconn".server
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". sh 里面默认jpda参数是 JPDA_TRANSPORT (Optional) JPDA transport used when the "jpda start" command is executed. The default is "dt_socket".ci
JPDA_ADDRESS (Optional) Java runtime options used when the "jpda start" command is executed. The default is 8000.io
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".