今日在tomcat下开发,为避免在没有改变java方法和类名的情况下重新加载整个webapp,查阅了些资料后需要启用jvm的jpda, 同时要能远程debug;研究了半天发现其实很简单,人家已经做的很好了;只需要加jpda 4个字母就可以了;修改startup.bat 找到call "%EXECUTABLE%" start %CMD_LINE_ARGS% 改为call "%EXECUTABLE%" jpda start %CMD_LINE_ARGS% 即可;这样在java的方法里面修改代码就不需要费时费力的重新加载上下文,也不需要重新登录。如果需要修改debug端口,(默认8000),改catalina.bat 中set JPDA_ADDRESS=8000 处;启动命令方式如下:echo Usage: catalina ( commands ... )echo commands:echo debug Start Catalina in a debuggerecho debug -security Debug Catalina with a security managerecho jpda start Start Catalina under JPDA debuggerecho run Start Catalina in the current windowecho run -security Start in the current window with security managerecho start Start Catalina in a separate windowecho start -security Start in a separate window with security managerecho stop Stop Catalinaecho version What version of tomcat are you running?
posted on 2014-10-23 10:50
wilsonyq 阅读(115)
评论(0) 编辑 收藏 所属分类:
Java 、
Tomcat