您的位置:首页 > 运维架构 > Tomcat

编译class不用重启tomcat

2010-11-18 14:09 239 查看
http://www.zeroturnaround.com/jrebel/

1、解压缩包

2、执行java -jar jrebel-setup.jar

3、会弹出一个安装界面(自己看,很好懂)

4、在MyEclipse中配置,找到服务器(如tomcat)的配置页面,在tomcat的jdk配置页面的Optional Java VM arguments输入框中加如下参数:

-noverify -javaagent:D:/dev/JRebel/jrebel.jar -Drebel.dirs=D:/dev/apache-tomcat-6.0.20/webapps/nmr

第一个路径是jar包的绝对路径,第二个地址是说想让哪个目录下的类更改后不重启服务。

如果Optional Java VM arguments输入框中有其他参数,用空格隔开。

5、发布项目,就能在控制台看到效果。

类就可以改变之后不用重启tomcat。

目前流行的服务器都支持。详细看官方网站。

-----------------------------------------------------------------------------------------------------------------------------------------

2010-10-28

Jrebel3.1.2a+eclipse3.6使用配置

文章分类:Java编程

我的确很懒,8月中旬就配置好了,直到现在才开始写这篇文章说说配置,其实网上已经有很多人写过相同主题的东东了。但是这是我自己的配置,自己记一笔,以后万一机器重装系统什么的,也可以按图索骥来一遍,很快的配置完成。

第一步:

将附件中3.1.2a解压到本地。然后将附件中jrebel.jar文件拷贝到解压路径覆盖原先的jrebel.jar.

第二步:

安装eclipse的jrebel插件。插件路径为:http://www.zeroturnaround.com/update-site/。

安装完成后在window-->preferences中的jrebel中进行设置,如下图:

第三步:

Windows--> show view--> other--> server--> servers.双击你的Server配置项

点击“ Open launch configuration”。如下图:

在VM arguments选框中加入参数:
-noverify -javaagent:D:/jrebel-3.1.2a/jrebel.jar
-Drebel.dirs=E:/workspace/fileManager1/WebRoot/WEB-INF/classes
-Drebel.spring_plugin=true
-Drebel.struts2-plugin=true

如下图:



然后点“OK”后,选取某个项目,启动server,如下图:

之后在console控制台中,看见下列文字,则表明jrebel配置成功.

Java代码

#############################################################

JRebel 3.1.2a (201008121555)

with Enterprise Add-On! (see http://jrebel.com/enterprise)
(c) Copyright ZeroTurnaround OU, Estonia, Tartu.

Over the last 1 days JRebel prevented

at least 0 redeploys/restarts saving you about 0 hours.

This product is licensed to www.cfsoft.com

for up to 9999 developer seats on site.

The following plugins are disabled at the moment:

* EclipseLink Plugin (set -Drebel.eclipselink_plugin=true to enable)

Reloads EntityManagerFactory when configuration changes

* Log4j plugin (set -Drebel.log4j-plugin=true to enable)

Reloads full configuration of log4j

* Stripes plugin 1.0.11 (set -Drebel.stripes_plugin=true to enable)

Adds reloading of Stripes ActionBeans.

* TopLink Plugin (set -Drebel.toplink_plugin=true to enable)

Reloads EntityManagerFactory when configuration changes

* TopLink Spring Plugin (set -Drebel.toplink_spring_plugin=true to enable)

Reloads SeesionFactory when configuration changes

* WebObjects Plugin (set -Drebel.webobjects_plugin=true to enable)

WebObjects JRebel Plugin

#############################################################

JRebel: Directory 'E:/workspace/fileManager1/WebRoot/WEB-INF/classes' will be monitored for class changes.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: