1, 编辑tomcat\bin\catalina.bat,在
rem Guess CATALINA_HOME if not defined
set "CURRENT_DIR=�%"
前添加以下代码以绑定一个端口8787:
if ""%1"" == ""stop"" goto skip_config
SET CATALINA_OPTS=-server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8787
:skip_config
2.在startup.bat下修改如下:找到 if "%OS%" == "Windows_NT" setlocal 然后加入
SET CATALINA_OPTS=-server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8787
3.Jboss
JAVA_OPTS=%JAVA_OPTS% -agentlib:jdwp=transport=dt_socket,address=%DEBUG_PORT%,server=y,suspend=n
standalone.bat --debug 9797