场景1,Tomcat6作为Windows服务运行

执行%catalina_home%/bin/tomcat6w.exe
在Java选项卡加入:

-Xrunjdwp:transport=dt_socket,address=8888,server=y,suspend=n

也可以在执行 service.bat install 之前修改 service.bat 中的这一行:(红色是要加入的)

"%EXECUTABLE%" //US//%SERVICE_NAME% ++JvmOptions "-Djava.io.tmpdir=%CATALINA_BASE%\temp;-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager;-Djava.util.logging.config.file=%CATALINA_BASE%\conf\logging.properties;-agentlib:jdwp=transport=dt_socket,address=8888,server=y,suspend=n" --JvmMs 128 --JvmMx 256
 

场景2,直接命令行/批处理启动Tomcat6

set JAVA_HOME=D:\Program Files\Java\jdk1.6.0_43

:: 下面这两种方法都可以
:: set JPDA_OPTS=-Xrunjdwp:transport=dt_socket,address=8888,server=y,suspend=n
set JPDA_OPTS=-agentlib:jdwp=transport=dt_socket,address=8888,server=y,suspend=n

cd bin
catalina.bat jpda start

参考:
http://www.ibm.com/developerworks/cn/java/j-lo-jpda1/
http://www.blogjava.net/askcuix/archive/2008/11/09/239529.html
http://blog.csdn.net/luoyahu/article/details/4037933
http://stackoverflow.com/questions/9620723/eclipse-failed-to-connect-to-remote-vm-connection-refused
http://hi.baidu.com/coolcooldool/item/cd21a87a7704493f70442303


本文链接地址: MyEclipse 远程调试 Tomcat6 上的程序
http://qingfengju.com/index.asp?id=349

分类:Web开发 查看次数:4897 发布时间:2013-9-28 13:45:37