eclipse修改java代码 ,重启tomcat不生效。每次都要tomcat-clean,project-clean,然后加载项目才可以。。。。怎么搞
下一个名为JREBEL的热部署软件,比如安装在D:\tools\JRebel5.5\
然后在eclipse里选择RUN->RUN CONFIGURATIONS (在左侧列表找到并选中对应的tomcat)->Arguments-->vm Arguments 的最后面添加如下代码:
-noverify
-javaagent:D:\tools\JRebel5.5\jrebel.jar
-Drebel.spring_plugin=true
-Drebel.spring-core_plugin=true
-Drebel.spring-beans_plugin=true
-Drebel.spring-aop_plugin=true
-Drebel.spring-mvc_plugin=true
-Drebel.spring-data_plugin=true
-Drebel.zk_plugin=true
-Drebel.aspectj_plugin=true
-Drebel.mybatis_plugin=true
可以换一个tomcat试一下。
如楼上所言,进行热部署。不过有的时候也不是很好用。
使用tomcat7可以实现热部署,如果是myeclipse在tomcat的安装目录conf下的server.xml中设置crossContext="true" reloadable=false,如果是eclipse在工作空间中的Server项目下,找到server.xml配置,贴上截图如下: