- 浏览: 484064 次
- 性别:
- 来自: 武汉
最新评论
-
zyzyzy123:
请问有工程吗,我现在正在实现打电话的功能,但是一直不通,怀疑是 ...
实用的java 串口通信程序 -
wuhaitong:
引用[img][/img][*][url][/url] ...
jbpm -
迷糊_le:
maven命令, 蛮好的,谢谢
maven eclipse -
Wuaner:
不错的文章 , 谢谢分享!
Hadoop -
yuqihengsheng:
strong 很细
HighLighter
Installation
JRebel installs as a JVM plugin (-javaagent) and works by monitoring the timestamp of class files. When it is updated (e.g. when a developer saves a class from the IDE) JRebel will reload the changes to class code and structure while preserving all existing class instances. The loading is lazy and will happen upon usage of the class (method call on an instance, static call on the class, field lookup etc).
Quick Start
- On Java 5 add -noverify -javaagent:/path/to/jrebel.jar to the JVM command line.
- On Java 1.4 you need to run java -jar jrebel.jar and then add -Xbootclasspath/p:/path/to/jrebel-bootstrap.jar;/path/to/jrebel.jar to the JVM command line.
- If you use exploded development or a standalone application then set IDE to compile to WEB-INF/classes or system classpath and changes will be picked up immediately on save.
- If you deploy as a WAR or an EAR then you need to create a rebel.xml configuration file as described further.
Some platforms and tools have their specific gotchas, so definitely take a look at the rest of the manual.
Step 0: Select your environment
窗体顶端
Java version: |
|
Operating system: |
|
Platform: |
Standalone applications BEA Weblogic 9.x+ GlassFish V2 Google App Engine 1.x IBM WebSphere 6.1+ JBoss 4+ Jetty 5+ Maven/Jetty Oracle Application Server 9.x Oracle Application Server 10.x Resin 3.0 Resin 3.1+ SAP NetWeaver 7.1 SpringSource dm Server 1.0 Tomcat 5+ Other |
窗体底端
Step 1: Configure the Platform
Tomcat
File: %TOMCAT_HOME%\bin\catalina.bat
Add the following line:
set JAVA_OPTS=-noverify -javaagent:jrebel.jar %JAVA_OPTS%
If you use the windows service or system tray startup use the following parameters instead:
-Xverify:none -javaagent:jrebel.jar
Step 2: Configure the Application
There are two ways to specify classes that will be monitored by JRebel for changes:
- All .class files in application classpath will be monitored by default (including system classpath, WEB-INF/classes, EJB module root, but exluding packaged JARs, WARs and EARs). If you use exploded or standalone development it is suggested to set the IDE compile output to application classpath and changes will be picked up on save.
-
You can put a rebel.xml file in the application or module classpath to mount external folders to the application classpath. There should be one rebel.xml file per application or module. It can be placed in:
- WEB-INF/classes
- APP-INF/classes
- EJB Module JAR root
- Library JAR root
NB! Never place rebel.xml in system/server classpath as it will cause classloading errors!
The rest of this section applies only to rebel.xml configuration. If you’re using exploded or standalone development feel free to skip right ahead to the Configuring Tools section.
If you are using Maven to build your application, we’d suggest you to use the Maven JRebel plugin to generate rebel.xml for you. You can read about it in the Configuring Tools section.
Configuring JARs
JARs are usually not deployed on their own, but as a part of application (e.g. WEB-INF/lib in WARs or EJB modules in EARs). However often you still want to update their code on-the-fly. Let’s assume that we have a module my-business-module.jar deployed in WEB-INF/lib. You can propagate the changes from your workspace by adding the following rebel.xml to the root of the JAR file:
<?xml version="1.0" encoding="UTF-8"?>
<application
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.zeroturnaround.com"
xsi:schemaLocation="http://www.zeroturnaround.com/alderaan/rebel-2_0.xsd">
<classpath>
<dir name="c:\myWorkspace\myBusinessModule\target\classes"/>
<dir name="c:\myWorkspace\myBusinessModule\src\main\resources"/>
</classpath>
</application>
This will mount classes and resources in directories c:\myWorkspace\myBusinessModule\target\classes and c:\myWorkspace\myBusinessModule\src\main\resources before the classes and resources in the JAR file. Changes to those classes and resources will propagate to the application.
Configuring WARs
In the case of a web application you have web application resources, like JSPs, HTML files, graphic files and so on in addition to the classpath. To configure a web application deployed as a WAR file we create a rebel.xml file in the WEB-INF/classes directory:
<?xml version="1.0" encoding="UTF-8"?>
<application
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.zeroturnaround.com"
xsi:schemaLocation="http://www.zeroturnaround.com/alderaan/rebel-2_0.xsd">
<classpath>
<dir name="c:\myWorkspace\myWar\target\classes"/>
<dir name="c:\myWorkspace\myWar\src\main\resources"/>
</classpath>
<web>
<link target="/">
<dir name="c:\myWorkspace\myWar\src\main\webapp"/>
</link>
<link target="/jsps/">
<dir name="c:\myWorkspace\myWar\src\main\jsps"/>
</link>
</web>
</application>
This will mount classes and resources in directories c:\myWorkspace\myWar\target\classes and c:\myWorkspace\myWar\src\main\resources to the application classpath before the deployed classes and resources. This means that those classes and resources will override the ones in WEB-INF/classes and WEB-INF/lib/*.jar. Changes to those classes and resources will propagate to the application.
This will also map the web resources in the c:\myWorkspace\myWar\src\main\webapp directory to the root (”/”) of the web application context and the web resources in c:\myWorkspace\myWar\src\main\jsps directory under the /jsps/ URI of the web application context. You may map several directories to one context target if necessary.
Configuring EARs
To configure a EAR you need to create a separate rebel.xml file for each EAR module. Web modules should be configured same as individually deployed WARs, EJB modules should be configured same as JARs. If your container supports APP-INF/classes you may also add a rebel.xml to that folder and mount classes and resources that belong to the EAR as a whole.
Tips and Tricks
- Putting absolute paths in the rebel.xml might be a bad idea as you’d like to share it with other team members. Luckily JRebel will expand expressions like “${myProject.root}” in rebel.xml to a system property that you can pass to the application container as -DmyProject.root=c:/myWorkspace/myProject. This allows to use a single configuration for everyone and then customize it when starting the server.
- You are not limited to mounting directories to classpath. You can also mount JARs with <jar>.
- If you need to mount a bunch of directories or JARs at once you can use <dirset> or <jarset> that accepts Ant-style patterns to specify the specific directories.
- You can use Ant FileSet-style include and exclude directives in <dir> and <jar> entries.
Read about those options and more in the configuration manual.
Step 3: Configuring Tools
To enable debugger to work with JRebel you should install this plugin.
You should configure the debugger to ignore synthetic methods. To do that open up debugger properties (File -> Settings -> Debugger). On the lower left corner of the debugger settings page make the necessary changes. Be sure to tick Skip synthetic methods checkbox and add the filters for com.zeroturnaround.* and org.zeroturnaround.*. You should also untick the checkbox Synthetic fields in the Show block of File -> Settings -> IDE settings -> Debugger -> Data Views
To stop IDEA from rebuilding the WAR file on every save right click on the web application, go to File -> Project Structure, click on the Web component of your web project (it’s a blue icon.), and then click on Java EE Build Settings. Uncheck both Create web facet war file, and Web Facet Exploded Directory.
Eclipse 3.x
You should also configure the debugger to ignore synthetic methods. To configure Eclipse go to Window -> Preferences and from there to Java -> Debug -> Step Filtering (or just search for “Step filtering”). Enable step filters and Filter synthetic methods. Make sure that Step through filters is also on. Now enable all the default filters and add com.zeroturnaround.* and org.zeroturnaround.*.
See also:
Netbeans 6.5
To enable debugger to work with JRebel you should install this plugin.
Maven 2.x
If you’re using Maven to build your application you can use the JRebel Maven plugin to automatically create a rebel.xml configuration file during the build.
To quickly configure the Maven plugin for war, jar and ejb modules add the following to your pom.xml:
<pluginRepository>
<id>zt-repo</id>
<name>Zero turnaround repo</name>
<url>dav:http://repos.zeroturnaround.com/maven2</url>
</pluginRepository>
...
<plugin>
<groupId>org.zeroturnaround</groupId>
<artifactId>jrebel-maven-plugin</artifactId>
<executions>
<execution>
<id>generate-rebel-xml</id>
<phase>process-resources</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>
For the rest of configuration options please visit the Maven plugin configuration manual.
ECLISPE WTP 集成 JAVAREBEL
JavaRebel 是一个 JVM 插件 (-javaagent) ,能够即时重载 java class 更改,因此不需要重新部署一个应用或者重启容器,节约开发者时间。
<!-- [if !supportLists]-->1、 <!-- [endif]-->下载j avarebel.jar 和 javarebel.lic 。注意
javarebel.jar 包不可改名,
javarebel.lic 放同目录
2 、 ECLIPSE 应用设好 TOMCAT 服务器后,进入【 Run > Run Configuration 】界面,在 VM 参数前加入 ”-noverify -javaagent:D:\tomcat5.5\bin\javarebel.jar ” ,如图:
<!-- [if gte vml 1]><v:shapetype id="_x0000_t75" coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"> <v:stroke joinstyle="miter" /> <v:formulas> <v:f eqn="if lineDrawn pixelLineWidth 0" /> <v:f eqn="sum @0 1 0" /> <v:f eqn="sum 0 0 @1" /> <v:f eqn="prod @2 1 2" /> <v:f eqn="prod @3 21600 pixelWidth" /> <v:f eqn="prod @3 21600 pixelHeight" /> <v:f eqn="sum @0 0 1" /> <v:f eqn="prod @6 1 2" /> <v:f eqn="prod @7 21600 pixelWidth" /> <v:f eqn="sum @8 21600 0" /> <v:f eqn="prod @7 21600 pixelHeight" /> <v:f eqn="sum @10 21600 0" /> </v:formulas> <v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect" /> <o:lock v:ext="edit" aspectratio="t" /> </v:shapetype><v:shape id="_x0000_i1025" type="#_x0000_t75" style="width:414.75pt; height:259.5pt" mce_style="width:414.75pt; height:259.5pt"> <v:imagedata src="file:///C:\DOCUME~1\FNDSOF~1\LOCALS~1\Temp\msohtml1\01\clip_image001.png" mce_src="file:///C:\DOCUME~1\FNDSOF~1\LOCALS~1\Temp\msohtml1\01\clip_image001.png" o:title="" /> </v:shape><![endif]--><!-- [if !vml]--><!-- [endif]-->
3 、双击 Server , Server 配置中选择自动发布,如图:
<!-- [if gte vml 1]><v:shape id="_x0000_i1026" type="#_x0000_t75" style="width:414.75pt;height:259.5pt" mce_style="width:414.75pt;height:259.5pt"> <v:imagedata src="file:///C:\DOCUME~1\FNDSOF~1\LOCALS~1\Temp\msohtml1\01\clip_image003.png" mce_src="file:///C:\DOCUME~1\FNDSOF~1\LOCALS~1\Temp\msohtml1\01\clip_image003.png" o:title="" /> </v:shape><![endif]--><!-- [if !vml]--><!-- [endif]-->
4 、 Server 模块中 Disable 掉 Auto Reload ,如图:
<!-- [if gte vml 1]><v:shape id="_x0000_i1027" type="#_x0000_t75" style="width:414.75pt;height:259.5pt" mce_style="width:414.75pt;height:259.5pt"> <v:imagedata src="file:///C:\DOCUME~1\FNDSOF~1\LOCALS~1\Temp\msohtml1\01\clip_image005.png" mce_src="file:///C:\DOCUME~1\FNDSOF~1\LOCALS~1\Temp\msohtml1\01\clip_image005.png" o:title="" /> </v:shape><![endif]--><!-- [if !vml]--><!-- [endif]-->
5 、这样就配置完成了。启动 Server ,在 Tomcat 启动日志前看见日志:
##########################################################
ZeroTurnaround JavaRebel 2.0-M1 (200812031605)
(c) Copyright Webmedia, Ltd, 2007, 2008. All rights reserved.
This product is licensed to Jacky Liu
##########################################################
6 、在修改类后,不需要重新发布,再次调用用, Console 输出:
JavaRebel: Reloading class 'com.nx.study.Test'.
7 、至此恭喜你,成功了!
8 、这个配置主要在集成测试方面有好的效率,并不能代替单元测试。
发表评论
-
Apache + Tomcat集群配置详解
2013-10-15 19:57 742Apache + Tomcat集群配置详解 ... -
maven eclipse
2013-06-05 08:41 10961. 安装m2eclipse插件 要用Eclipse构 ... -
ZooKeeper API
2013-05-16 17:27 9151)ZooKeeper API 简介 ZooKeeper ... -
给DIV添加滚动条
2012-08-02 10:51 1139直接为div指定overflow ... -
jboss数据源
2012-03-21 15:19 916jboss.xml in ejb/META-INF ... -
Apache+Jobss cluster安装配置
2012-03-21 11:21 1142系统环境:OS:linux AS4 2.6.9-78.EL A ... -
Spring 事务
2012-02-14 12:26 1030Spring 事务不回滚的问题关键是:不能对该异常用 ... -
Apache 负载均衡+Tomcat集群
2012-01-17 08:45 1131一、本机环境 1.Windows 7 64位操作系统 2. ... -
ESB企业服务总线
2011-12-20 15:37 1329ESB是企业服务总线(Ente ... -
定庄记忆法
2011-08-13 10:53 1057桩可以分为大中小三类 ... -
Android开发环境搭建全程演示(jdk+eclip+android sdk)
2011-07-12 13:44 938Android开发环境搭建全程演示(jdk+eclip+a ... -
jbpm
2011-05-17 14:44 2050JBPM_ACTION action记录表 JBPM_DECI ... -
企业信息化十年
2010-12-02 22:06 9572000年之前:宇宙大爆炸 ... -
首先,遍历map有以下方法:
2010-10-22 13:00 1505首先,遍历map有以下方 ... -
职场能力
2010-10-02 17:49 1100如今职场竞争越发激烈,一大群求职者竞聘同一个(或少数几个)岗位 ... -
tomcat 配置
2010-09-24 10:39 10141、 PermGen space的全称是Permanent ... -
YUI:带checkbox的TreeView的赋值与读值
2010-09-18 21:26 2148日前做一个用户权限管理的页面,权限是一个树形结构,每个节点前是 ... -
Spring中的Assert工具类
2010-09-05 21:02 917方法入参检测工具 ... -
comments
2010-09-02 21:25 1142Item Description Comments ... -
tomcat 配置
2010-09-02 06:43 1465Tomcat内存溢出的原因 在生产环境中tomcat内存设置 ...
相关推荐
安装jrebel插件后找到C盘下的.jrebel文件,直接解压替换就可以用了。
2.下载jrebel破解文件,放到eclipse的jrebel插件目录覆盖: plugins\org.zeroturnaround.eclipse.embedder_6.5.0.RELEASE\jrebel 3.启动eclipse 查看window->preferences->jrebel 会提示没有license,无视他吧,...
**JRebel插件安装指南** JRebel是一款强大的Java开发者工具,它允许开发者在运行时立即看到代码更改的效果,而无需重新部署应用。这款插件极大地提高了开发效率,节省了构建和部署应用的时间。本指南将详细介绍如何...
**JRebel 插件详解** JRebel 是一款强大的Java开发工具插件,它能够极大地提高开发者的生产力,尤其是在进行持续集成和快速迭代时。JRebel 的核心功能是实时应用代码更改,无需重启应用服务器,即可看到代码变动的...
JRebel破解方法1
IDEA安装热部署插件JRebel
《JRebel 4.1版本:提升Java开发效率的利器》 JRebel是一款备受开发者欢迎的实时应用服务器插件,它极大地提高了Java开发者的效率,尤其在JRebel 4.1版本中,这一优势更为显著。该版本专为IntelliJ IDEA集成开发...
在`catalina-jrebel.bat`中,你需要引入JRebel的jar文件(这里为`jrebel.jar`),并在启动参数中加入JRebel的相关配置: ```bash set JPDA_OPTS=-javaagent:jrebel.jar ``` 此外,`jrebel.info`文件通常用于记录...
**IDEA JRebel热部署插件jar包详解** 在Java开发过程中,IDE(Integrated Development Environment)扮演着至关重要的角色,而IntelliJ IDEA作为其中的一款顶级IDE,为开发者提供了丰富的功能和高效的开发体验。然而...
JRebel是一款强大的Java开发工具,它允许开发者在不重启应用服务器的情况下实时看到代码更改的效果,极大地提高了开发效率。Idea是JetBrains公司推出的著名Java集成开发环境IntelliJ IDEA的简称,广受开发者喜爱。...
**JRebel安装使用教程** JRebel是一款强大的Java开发工具,它允许开发者在不重启应用服务器的情况下实时看到代码变更的效果,极大地提升了开发效率。本文将详细介绍JRebel的安装和使用过程。 ### 一、JRebel简介 ...
【标题】:Tomcat热加载Jrebel 在Java Web开发中,Tomcat是一个广泛使用的应用服务器,用于部署和运行Servlet和JSP应用程序。然而,每次修改代码后,都需要重新启动Tomcat来使更改生效,这无疑降低了开发效率。为了...
jrebel破解版 最新的jrebel 7.1.2 破解版 jrebel破解版 最新的jrebel 7.1.2 破解版jrebel破解版 最新的jrebel 7.1.2 破解版
**JRebel 6.4.1:热部署神器** 在软件开发过程中,尤其是Java后端开发,我们经常需要频繁地修改代码以测试不同的功能或优化性能。每次修改后,传统的方法是重新编译并部署应用,这不仅耗时,而且打断了开发的连续性...
idea中jrebel插件,也可在官网去找,方便开发,一个热部署,热更新的插件
JRebel eclipse 热部署
JRebel是一款强大的Java开发工具,它允许开发者在Eclipse集成开发环境中实时看到代码更改的效果,无需重新编译和重启应用服务器。这个Eclipse插件极大地提升了开发效率,减少了等待时间,让开发者能够更快地迭代和...
-noverify -javaagent:D:\apps\jrebel6.4.3\jrebel.jar -Xbootclasspath/p:D:/apps/jrebel6.4.3/rebelboot.jar -Drebel.base=D:\apps\jrebel6.4.3\.jrebel -Drebel.disable_update=true D:\apps\jrebel6.4.3这个为...
Jrebel 离线激活配置 使用压缩包的文件覆盖替换本地 Jrebel 文件 本地 jrebel 配置文件一般在:C:\Users\(用户名)\.jrebel
JRebel是一款JavaEE开发工具。JRebel允许开发团队在有限的时间内完成更多的任务修正更多的问题,发布更高质量的软件产品。 IDEA上原生是不支持热部署的,一般更新了 Java 文件后要手动重启 Tomcat 服务器,才能生效...