JVM (tomcat bin\catalina.bat 文件中)
默认有一行
set JPDA_OPTS=-Xdebug -Xrunjdwp:transport=%JPDA_TRANSPORT%,address=%JPDA_ADDRESS%,server=y,suspend=%JPDA_SUSPEND%
添加一行
JAVA -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8570,server=y,suspend=y
下面两行差不多,不过上面一行有效
#JAVA_OPTS="$JAVA_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8570"
#set CATALINA_OPTS=-server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=y,suspend=n,address=8570
启动startup.bat如下
进入eclipse,
点击 run debug configurations
remote java application
新建一个,取一个名,输入host和端口号,选择common,勾选debug
点击debug后就启动这个tomcat了。
报错:timeout 连接超时 端口或地址不对,要不就是启动的有问题
connection result 连接被拒,配置的不对
参考 http://blog.csdn.net/shangzhiliang_2008/article/details/5723899