`
neolimeng
  • 浏览: 83682 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

在Eclipse中集成JRebel实现Java热部署

    博客分类:
  • Java
阅读更多

以前老有人说 JRebel 调试的时候会出问题, 好像是需要配置一下才可正确调试, 这里转一篇官方的文章:

http://www.zeroturnaround.com/blog/how-to-install-and-use-jrebel-formerly-javarebel-in-tomcat-with-the-eclipse-ide/

 

How to install and use JRebel in Tomcat, JBoss or Jetty with the Eclipse IDE

September 9th, 2009 by Toomas Römer

Although this tutorial concerns the Tomcat container, exactly the same instructions also can be used for JBoss and Jetty containers.

Compared to other containers out there, the Tomcat web container is one of the fastest when it comes to startup and redeploy times. Still, in asurvey we conducted, developers estimate spending 18% of their coding time (about 145 hours annually, per developer – somewhere between 3-4, full, 40-hour workweeks) waiting for applications to redeploy. JRebel eliminates the need to redeploy in 80% of situations, and it’s easy to get started. In the embedded video you can take a quick look at how coding looks when using JRebel.

Tutorial

In this tutorial we explain how to install and use it step-by-step. We assume that you are using Eclipse 3.x with Tomcat 5.x or later. Most of the steps will be applicable to other versions as well, but it may look different from the screenshots included.

Contents:

STEP 1: Install JRebel

The latest stable version of JRebel can be downloaded here. Unpack it to a directory of your choice.

2009-07-03_124429

STEP 2: Installing JRebel Eclipse IDE plugin

The JRebel Eclipse IDE plugin was introduced with JRebel 2.0 and makes configuring and using JRebel considerably easier. You can install the plugin by going to Help » Software updates » Available software » Add site and use the http://www.zeroturnaround.com/update-site/ URL as the update site.

2009-07-15_142449

STEP 3: Make a rebel.xml for your application

In order to do it’s magic, JavaRebel needs to know where your classes and resources are. We’ll use a rebel.xml configuration file to tell it. This is mandatory when you deploy your app as a WAR/EAR. You’ll need to have one rebel.xml file per module. This includes both web and EJB modules. The rebel.xml configuration file should be placed in your WEB-INF/classes directory in the case of a web module and in the jar root in the case of an ejb module. Put it in the root of a source or resource folder in your project (the same place where the .properties files are).

If you use Maven you can use the JavaRebel Maven plugin that will generate the rebel.xml in accordance with the module pom.xml as described in theMaven Plugin configuration manual.

In 99% of cases, you probably use one module per project. In these cases, the JavaRebel Eclipse IDE plugin can generate the rebel.xml file for you, on a per project basis. If your project is one of the exceptions, edit the file manually as described in the Installation manual, otherwise generate the rebel.xml like this:

Click on your project and pick Generate rebel.xml.

2009-07-15_143501

Repeat this for all projects that you’d like to update with JRebel.

If you’d like to use one rebel.xml for your whole team, start with the generated rebel.xml, then replace the absolute paths to your workspace with a system property. JavaRebel 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 you to use a single configuration for everyone and then customize it when starting the server.

STEP 4: Configuring the Eclipse WTP IDE

You may skip this step if you run Tomcat outside of the Eclipse IDE.

Open the Servers View and double click the Tomcat Server that your application is deployed to (if you don’t see the Servers View go to Window » Show View » Servers).

2009-07-15_144828

Open Publishing and choose Never publish automatically.

2009-07-15_144654

It may seem strange to disable automatic publishing, but as JRebel will take care of updates from now on it would just slow you down.

Open JavaRebel Integration and check Enable JavaRebel agent.

2009-07-15_145028

STEP 5: Configuring the Eclipse IDE

Go to Window » Preferences and from there to Java » Debug » Step Filtering.

Check Use Step FiltersFilter synthetic methods, and Step through filters. Now check all the default filters and use the Add Filter button to add com.zeroturnaround.* and org.zeroturnaround.*.

2009-07-03_143321

Now go to Project » Build automatically and make sure it is checked.

2009-07-03_144612

STEP 6: Success!

To check that the installation was successful, access a page that uses a class, change that class in the IDE, press Save, access the page again and look for the following message in the console:

2009-07-15_150006

Now that you’re up and running, it’s time to enjoy coding without the need to redeploy. If you have any specific questions JRebel, the Forum is the best place to ask, so that other people get to hear the answer as well. Otherwise, you can contact us at support@zeroturnaround.com.

If you like what you see, please give us a quick mention on your blog or twitter (you can even follow us here).

Have a great day!

Find out more:

分享到:
评论

相关推荐

    ecilipse+tomcat+jrebel实现热部署

    在本文中,我们将介绍如何使用 Eclipse、Tomcat 和 JRebel 实现热部署。首先,需要下载 JRebel 的插件 update-site-6.4.0.RELEASE,并安装到 Eclipse 中。然后,需要破解 JRebel 的许可证,以便能够使用 JRebel 的...

    jrebel 配置eclipse 热部署 有文档 与jar

    2. **Eclipse集成JRebel** 要在Eclipse中配置JRebel,首先需要从其官方网站下载JRebel的zip安装包,然后在Eclipse的插件管理器中导入该zip文件进行安装。安装完成后,需要在Eclipse的偏好设置中配置JRebel的许可证...

    eclipse修改代码后热部署(不需要重启服务

    在Eclipse中,实现热部署的一种常见方式是通过插件JRebel。JRebel是一款商业的热部署工具,它能够实时反映代码更改,避免了反复重启服务器的过程。下面是使用JRebel进行热部署的步骤: 1. **安装JRebel插件**:访问...

    IDEA与Eclipse的JRebel插件

    JRebel是一款强大的热部署工具,尤其在Java Web开发中,它能够显著减少因代码修改而频繁重启应用服务器所浪费的时间。 ### IDEA与Eclipse中的JRebel插件 **JRebel简介** JRebel由Zeroturnaround公司开发,它的核心...

    update-site-jrebel eclipse maven热部署插件

    标题中的"update-site-jrebel eclipse maven热部署插件"指的是Eclipse集成开发环境(IDE)中的一个插件更新站点,它专门针对JRebel和Maven项目提供了热部署功能。JRebel是一款强大的Java应用热部署工具,能够实现在...

    jrebel热部署工具-eclipse

    标题中的"JRebel热部署工具-eclipse"指的就是将JRebel这个神器与Eclipse集成,以提升Java Web开发的效率。Eclipse作为广泛使用的Java集成开发环境(IDE),在开发者社区中拥有极高的声誉。然而,Eclipse默认的机制...

    Jrebel 基于TOMCAT实现项目修改热部署

    下面将详细介绍 JRebel 如何与 Tomcat 集成,实现项目修改后的热部署。 **1. JRebel 的工作原理** JRebel 是通过动态类加载技术,实现在运行时替换已经加载的类,以达到热部署的效果。它拦截了 JVM 的类加载过程,...

    jrebel_6.5.2_Java热部署插件

    **Java热部署插件——JRebel 6.5.2** JRebel是一款高效便捷的Java应用热部署工具,它的出现极大地提升了开发者的效率,避免了在开发过程中频繁重启应用服务器来查看代码更改的效果。标题提到的是"jrebel_6.5.2",这...

    tomcat远程debug与jrebel热部署文件

    总结来说,通过配置Tomcat的远程调试和集成JRebel,你可以实现快速的故障排查和无中断的代码更新。这种方式对于提高开发效率和优化工作流程具有显著效果。在实际操作中,务必确保安全设置,避免未授权的远程访问,并...

    jrebel6.4.1 热部署神器

    为了解决这个问题,"jrebel6.4.1 热部署神器"应运而生,它是一种高效、便捷的工具,能够实现在不重启应用的情况下即时看到代码改动的效果。 **JRebel 简介** JRebel 是由Zeroturnaround公司开发的一款强大的Java...

    JRebel IDE热部署插件

    JRebel通过动态类加载技术实现了热部署。它监控代码的修改,一旦检测到变化,就会自动将新版本的类加载到运行时环境中,而无需重启应用。这样,开发者就可以立即看到代码更改的结果,减少了等待时间,提升了开发流程...

    eclipse 插件 jrebel

    JRebel则是一款强大的热部署工具,它允许开发者在编写代码时无需重启应用服务器,即可实时看到代码变更的效果。这极大地提高了开发效率,尤其是在进行持续集成和快速迭代的项目中。 JRebel插件是将JRebel的功能集成...

    jrebel6.5 热部署

    在Java开发环境中,"热部署"是一种高效的工作模式,它允许开发者在不重启应用服务器的情况下更新代码并立即看到效果。这极大地提高了开发效率,减少了因反复重启应用而浪费的时间。JRebel是一款知名的热部署工具,其...

    java热部署工具

    1. **JRebel**: JRebel是一款商业的Java热部署工具,它可以直接在JVM中实现类的热更新,而无需重启服务器。开发者只需要在IDE中配置JRebel插件,并将项目指向JRebel代理的类加载器,就可以实时看到代码更改的效果。 ...

    eclipse热部署插件

    JRebel是一款强大的热部署工具,它允许开发者在不重启应用服务器的情况下,实时看到代码的更改效果。这极大地节省了开发时间,提高了开发效率。JRebel能够即时更新Java类、资源文件、Spring配置、MyBatis映射文件等...

    jrebel安装包及远程热部署

    在本文中,我们将深入探讨JRebel的安装过程以及如何实现远程热部署。 首先,让我们详细了解JRebel。JRebel是由Zeroturnaround公司开发的一款即时应用服务器插件,它通过动态加载更改到运行的应用程序中,省去了传统...

    eclipse中jrebel7.0.2离线插件包(带使用说明)

    而JRebel是一款强大的热部署工具,能够显著提升开发效率。在Eclipse中安装JRebel插件,可以让开发者在修改代码后无需重启应用服务器就能看到更新的效果,极大地节省了开发过程中的等待时间。 JRebel 7.0.2是该插件...

    eclipse 热部署插件

    Eclipse中的热部署插件主要指的是JRebel,这是一款由Zeroturnaround公司开发的强大工具。JRebel与Eclipse紧密集成,能够实时同步代码变更到运行的应用中,不仅支持Java,还支持多种框架和库,如Spring、Hibernate等...

    Jrebel 7.1.3 eclipse离线插件

    - 实时热部署:JRebel避免了传统开发过程中反复构建和部署的步骤,当你修改了Java类、资源文件或配置文件后,改动会立即生效,提高开发效率。 - 类加载优化:JRebel智能地管理类加载,确保新版本的类正确覆盖旧...

Global site tag (gtag.js) - Google Analytics