[Eclipse]

使用Eclipse + Tomcat,要使用热加载,总是会重启tomcat webapp。

可以使用这个插件:jrebel

如果是Tomcat 7.0+版本,需要使用jrebel5.5.1+的版本,不然总会报一些错误。

使用方法:

1) 下载jrebel 5.5.1+

2) 右键项目,选择:

3) 找到"VM arguments":

里头填入:

-Dcatalina.base="E:JavaProject.metadata.pluginsorg.eclipse.wst.server.core	mp0" -Dcatalina.home="D:Program Filesapache-tomcat-7.0.54" -Dwtp.deploy="E:JavaProject.metadata.pluginsorg.eclipse.wst.server.core	mp0wtpwebapps" -Djava.endorsed.dirs="D:Program Filesapache-tomcat-7.0.54endorsed"
-noverify -javaagent:F:ToolsJavajrebeljrebel.jar
-Drebel.dirs=E:JavaProjectobsWebContentWEB-INFclasses
-Drebel.spring_plugin=true
-Drebel.struts2-plugin=true

说明:

-noverify:解压的jrebel.jar文件地址

-Drebel.dirs:项目编译的classes地址

-Drebel.spring_plugin:使用了spring,设为true

-Drebel.struts2-plugin:使用了struts,设为true

4) 把eclipse的tomcat启用自动加载功能停了,以防止它总是自动重启tomcat

好了,现在修改一个java方法,保存试试。


其实,tomcat使用Run Debug方式也可以达到这样的效果:

原文地址:https://www.cnblogs.com/HD/p/4045382.html