从网上查到的资料中,提到了两种安装方式,一种是eclipse的插件方式,一种是直接设置tomcat的jvm参数的方式,本来想用第一种方式来的直观,结果,从官网上更新了插件后,根据官方提供的安装方法(How to install and use JRebel in Tomcat, JBoss or Jetty with the Eclipse IDE http://www.zeroturnaround.com/blog/how-to-install-and-use-jrebel-formerly-javarebel-in-tomcat-with-the-eclipse-ide/),到了第4步,硬是点不出来那个设置的对话框,找了老半天也没有找到,不知道是怎么回事!希望安装成功能高手能详细的说一下是怎么操做的。
无耐,又选择用第二种方法来安装,第二种方法的安装比较简单,但是,在设置jvm参数的时候,也要注意一些细节,具体的方法就是(此处以tomcat6为例):window-preferences-servers-tomcat-tomcat 6.x-jdk-Optional java vm arguments这个框里面输入java vm的参数,具体设置如下:
- -noverify
- -javaagent:F:/jrebel-3.0-M1/jrebel.jar
- -Drebel.dirs=F:\MyEclipse7.0M1\eclipse\workspace\qhtjProject_new\WebRoot\WEB-INF\classes
个别参数说明:
-javaagent: 这个是你使用的javaRebel(jRebel)的jar包的路径,注意其中的斜线方向。
-Drebel.dirs= 这个是你要监控的项目的class文件路径
设置完成后,确定,返回。下来把tomcat的<Context reloadable="false" ............ /> reloadable="false"这里要设置成false才可以。至此,就算配置完成了,启动tomcat就会在控制台看到有关javaRebel(jRebel)的输入信息:
- Mon Oct 26 17:46:15 CST 2009 com.zeroturnaround.javarebel.hD#new V( false )
- Mon Oct 26 17:46:15 CST 2009 com.zeroturnaround.javarebel.bH#public boolean a(byte abyte0[])
- #############################################################
- 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 0 redeploys/restarts.
- Using industry standard build and redeploy times,
- JRebel saved you between 0 and 0 hours.
- This product is licensed to Java Hack Organization
- for unlimited number of developer seats on site.
- #############################################################
OK,到此就说明配置成功了,下来,可以试试修改了java类文件后,还有没有容器自动加载的漫长过程了!!赶快去试一下吧!!!!
原文:http://city-moon.iteye.com/blog/504557
参考:http://stockwyz.blog.hexun.com/51582745_d.html
http://www.blogjava.net/xylz/archive/2011/06/12/352109.html
http://zeroturnaround.com/jrebel/documentation/