Tomcat配置遠程調試端口

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".

相關文章
相關標籤/搜索