javarebel 可使Java class文件从新加载速度更快,节省了开发时间,并且修改了配置文件和在class中加入任何的代码都不用重启服务器,彻底支持Annotation reloading.(Annotation动态载入),当classes字节码文件从新载入的时,它会在触发寄存器监听,容许使用自定义的方法去处理。 java
因此当修改过代码后就会触发监听而后修改完后从新加载,实现真正意义上的热部署! web
配置: windows
在windows/preferences/MyEclipse/Servers/Tomcat/Tomcat 6.x/点击JDK后会出在右边出现一个Optional Java VM arguments文本框,而后在里面输入如下代码: tomcat
-noverify
-javaagent:E:/src/jrebel-3.0-M1/jrebel.jar
-Drebel.dirs=E:\frameWork\strutsWork\SpringMVC2\WebRoot\WEB-INF\classes 服务器
其中javaagent为jrebel.jar所放的目录,drebel.dirs为工程目录中.编译事后生成.class文件生成的目录。这样配置完成以后,点应用。从新启动tomcat服务器,后台会出现如下文字: eclipse
JRebel 3.0-M1 (200910151623)
(c) Copyright ZeroTurnaround, Ltd, 2007-2009. All rights reserved.
A rough estimate: Over the last 1 days JRebel
prevented the need for at least 3 redeploys/restarts.
Using industry standard build and redeploy times,
JRebel saved you between 0.1 and 0.2 hours.
This product is licensed to Java Hack Organization
for unlimited number of developer seats on site. 测试
JRebel: Directory 'E:\frameWork\strutsWork\SpringMVC2\WebRoot\WEB-INF\classes' will be monitored for class changes.//会监测类的变化 ui
这样完成以后若是你修改了类就会出现这么一句话: spa
JRebel: Reloading class 'com.fhqihwcw.tag.HasPermission'.//这是我测试用的类 插件
就是从新加载你的.class文件无须再去从新启动服务器。。。。。修改代码和新加方法都会进行从新部署!