JRebel Reference Manual

©ZeroTurnaround OÜ, Estonia, Tartu


Preface
1. Installation
1.1 ZIP Archive
1.2 License Setup
1.3 Uninstallation
2. IDE Configuration
2.1 Introduction
2.2 Eclipse
2.3 MyEclipse 9.1 or later
2.4 IntelliJ IDEA 8.x or later
2.5 IntelliJ IDEA X or later
2.6 NetBeans 7.x
2.7 Oracle JDeveloper
3. Application Configuration
3.1 rebel.xml Basics
3.2 Eclipse
3.3 MyEclipse 9.1 or later
3.4 IntelliJ IDEA 8.x/9.x
3.5 IntelliJ IDEA X or later
3.6 NetBeans 7.x
3.7 Maven
3.8 rebel.xml Reference
3.8.1 <application>
3.8.2 <classpath>
3.8.3 <dir>
3.8.4 <dirset>
3.8.5 <jar>
3.8.6 <jarset>
3.8.7 <war>
3.8.8 <web>
3.8.9 <link>
3.8.10 <include>
3.8.11 <exclude>
4. Server Configuration
4.1 Quick Start
4.2 Eclipse
4.3 MyEclipse 9.1 or later
4.4 IntelliJ IDEA 8.x, 9.x
4.5 IntelliJ IDEA X or later
4.6 Java 5.x or later (Sun or JRockit JVM)
4.6.1 Standalone Applications on Windows
4.6.2 Standalone Applications on Linux/Mac OS X
4.6.3 Apache Geronimo on Windows
4.6.4 Apache Geronimo on Linux/Mac OS X
4.6.5 Google App Engine 1.x on Windows
4.6.6 Google App Engine 1.x on Linux/Mac OS X
4.6.7 Google Web Toolkit on Windows
4.6.8 Google Web Toolkit on Linux/Mac OS X
4.6.9 GlassFish V2, V3 on Windows
4.6.10 GlassFish V2, V3 on Linux/Mac OS X
4.6.11 JBoss 4.x, 5.x, 6.x on Windows
4.6.12 JBoss 4.x, 5.x, 6.x on Linux/Mac OS X
4.6.13 JBoss 7.x on Windows
4.6.14 JBoss 7.x on Linux/Mac OS X
4.6.15 Jetty 5.x, 6.x, 7.x on Windows
4.6.16 Jetty 5.x, 6.x, 7.x on Linux/Mac OS X
4.6.17 Jetty 8.x on Windows
4.6.18 Jetty 8.x on Linux/Mac OS X
4.6.19 Maven Jetty plugin (mvn jetty:run) on Windows
4.6.20 Maven Jetty plugin (mvn jetty:run) on Linux/Mac OS X
4.6.21 Oracle Application Server 10.x on Windows
4.6.22 Oracle Application Server 10.x on Linux/Mac OS X
4.6.23 Oracle Application Server 9.x on Windows
4.6.24 Oracle Application Server 9.x on Linux/Mac OS X
4.6.25 Caucho Resin 3.1.x, 4.x on Windows
4.6.26 Caucho Resin 3.1.x, 4.x on Linux/Mac OS X
4.6.27 Caucho Resin 3.0.x on Windows
4.6.28 Caucho Resin 3.0.x on Linux/Mac OS X
4.6.29 SAP NetWeaver 7.1.x on Windows
4.6.30 SAP NetWeaver 7.1.x on Linux/Mac OS X
4.6.31 SpringSource dm Platform (Eclipse Virgo) on Windows
4.6.32 SpringSource dm Platform (Eclipse Virgo) on Linux/Mac OS X
4.6.33 Spring tc Server on Windows
4.6.34 Spring tc Server on Linux/Mac OS X
4.6.35 Tomcat 4.x, 5.x, 6.x, 7.x on Windows
4.6.36 Tomcat 4.x, 5.x, 6.x, 7.x on Linux/Mac OS X
4.6.37 MuleSoft TCat on Windows
4.6.38 MuleSoft TCat on Linux/Mac OS X
4.6.39 Oracle Weblogic 9.x, 10.x, 12.x on Windows
4.6.40 Oracle Weblogic 9.x, 10.x, 12.x on Linux/Mac OS X
4.6.41 IBM WebSphere AS CE on Windows
4.6.42 IBM WebSphere AS CE on Linux/Mac OS X
4.6.43 Other on Windows
4.6.44 Other on Linux/Mac OS X
4.7 Java 1.4.x (Sun or JRockit JVM)
4.7.1 Standalone Applications on Windows
4.7.2 Standalone Applications on Linux/Mac OS X
4.7.3 JBoss 4.x on Windows
4.7.4 JBoss 4.x on Linux/Mac OS X
4.7.5 Jetty 5.x, 6.x on Windows
4.7.6 Jetty 5.x, 6.x on Linux/Mac OS X
4.7.7 Maven Jetty plugin (mvn jetty:run) on Windows
4.7.8 Maven Jetty plugin (mvn jetty:run) on Linux/Mac OS X
4.7.9 Oracle Application Server 10.x on Windows
4.7.10 Oracle Application Server 10.x on Linux/Mac OS X
4.7.11 Oracle Application Server 9.x on Windows
4.7.12 Oracle Application Server 9.x on Linux/Mac OS X
4.7.13 Caucho Resin 3.0.x on Windows
4.7.14 Caucho Resin 3.0.x on Linux/Mac OS X
4.7.15 SAP NetWeaver 7.0.x on Windows
4.7.16 SAP NetWeaver 7.0.x on Linux/Mac OS X
4.7.17 Tomcat 4.x, 5.0.x on Windows
4.7.18 Tomcat 4.x, 5.0.x on Linux/Mac OS X
4.7.19 Oracle Weblogic 7.x, 8.x on Windows
4.7.20 Oracle Weblogic 7.x, 8.x on Linux/Mac OS X
4.8 IBM JVM (Java 1.4.x or later)
4.8.1 IBM WebSphere 6.0.x, 6.1.x, 7.x on Windows
4.8.2 IBM WebSphere 6.0.x, 6.1.x, 7.x on Linux/Mac OS X
4.8.3 Other servers or applications using IBM JDK on Windows
4.8.4 Other servers or applications using IBM JDK on Linux/Mac OS X
5. Agent Configuration
5.1 Generic
5.2 Plugins

1. Installation

1.1 ZIP Archive
1.2 License Setup
1.3 Uninstallation

Installation Overview

JRebel is provided as IDE plugin for Eclipse, IntelliJIDEA and NetBeans, and as ZIP archive distribution. To install JRebel for the preferred IDE locate it in the IDE plugins repository and install from there. For the rare cases when the manual setup is required, the ZIP archive is provided. The ZIP archive can be downloaded from JRebel home page.

1.1 ZIP Archive

By selecting ZIP Archive download option you will be provided the archive with the JRebel install directory. Just unpack the archive to the location of your choice. After you have unpacked the archive, it would be wise to setup the environment variables to make use of it later as configure JRebel for you application server and your project.

1.2 License Setup

After the software is installed, the license must be configured. The configuration wizard, bundled with the software provides options for registering your license.

The configuration wizard can be cound in JRebel installation directory under bin/ folder. The application is started using jrebel-config.cmd on Windows, or jrebel-config.sh on Linux machine. To start the registration process, please select one of the options provided:

Already a user

By choosing the very first option, I already have a JRebel license key (skip to Activation page) you will be forwarded to the next page of the wizard for license setup. You can either specify the path to the license file, or alternatively, the license file can be saved to .jrebel directory under your user home folder, e.g. /home/<username>/.jrebel

New evaluation

For the first time users the evaluation license for 30 days is provided for free. By choosing the second option, I'm a new user and need an evaluation license, you will be asked to fill the registration form form. Please provide the correct data and a valid e-mail address. The license file should be delivered to you in a few minutes.

1.3 Uninstallation

To uninstall JRebel just remove the plugin from your IDE or, if you used ZIP archive to install JRebel, you can delete JRebel directory where you have unpacked it.

2. IDE Configuration

2.1 Introduction
2.2 Eclipse
2.3 MyEclipse 9.1 or later
2.4 IntelliJ IDEA 8.x or later
2.5 IntelliJ IDEA X or later
2.6 NetBeans 7.x
2.7 Oracle JDeveloper

2.1 Introduction

JRebel IDE plugins are available for Eclipse, IntelliJ IDEA and NetBeans and provide the following features:

Debugger
Support for debugging the application with JRebel agent enabled. Necessary to set breakpoints, inspect expressions and step through code.
Running with JRebel
Support for starting the application or server from withing the IDE with the JRebel agent enabled. [Missing in NetBeans and IntelliJ IDEA before 8.x]
rebel.xml generation
Support for generating the rebel.xml configuration file from the IDE project definition. [Missing in NetBeans and IntelliJ IDEA before 8.x]

2.2 Eclipse

Install the JRebel Eclipse plugin by going to Help » Install New Software... and use the URL :
http://www.zeroturnaround.com/update-site/

For offline installation use the downloadable zip archive instead:
http://www.zeroturnaround.com/update-site/update-site.zip


install


If you chose not to use the embedded JRebel, you need to specify the path to jrebel.jar manually. Go to Window » Preferences » JRebel, browse to the installation directory and select the jrebel.jar


preferences


There are also some tweaks to be done in the debugger settings. Go to Window » Preferences and from there to Java » Debug » Step Filtering.

Check Use Step Filters, Filter 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.*.


Step Filtering


For best experience, go to Project » Build Automatically and make sure it is checked.


Build Automatically

2.3 MyEclipse 9.1 or later

Install the JRebel MyEclipse plugin by going to Help » Install New Software... and use the URL :
http://www.zeroturnaround.com/update-site/

For offline installation use the downloadable zip archive instead:
http://www.zeroturnaround.com/update-site/update-site.zip


install


If you chose not to use the embedded JRebel, you need to specify the path to jrebel.jar manually. Go to Window » Preferences » JRebel, browse to the installation directory and select the jrebel.jar


preferences


There are also some tweaks to be done in the debugger settings. Go to Window » Preferences and from there to Java » Debug » Step Filtering.

Check Use Step Filters, Filter 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.*.


Step Filtering


For best experience, go to Project » Build Automatically and make sure it is checked.


Build Automatically

2.4 IntelliJ IDEA 8.x/9.x

The plugin is hosted at the central IntelliJ plugin repository. The easiest way to install is to go to File » Settings » Plugins in IntelliJ and use the built-in interface for installing. The plugin name is JRebel Plugin (formerly JavaRebel). If you have previously installed the older JavaRebelIdeaDebuggerPlugin please uninstall it. You can check out the plugin page for more information about the releases of the plugin.


JavaRebel Plugin installation


Since JRebel installation is done independently from the plug-in installation, one should point IntelliJ plug-in to jrebel.jar explicitly. Go to Settings » JRebel » JRebel location and browse to the jrebel.jar location on your filesystem (it's %REBEL_HOME%\jrebel.jar).


Specify jrebel.jar location


There are also some tweaks to be done in the debugger settings:

2.5 IntelliJ IDEA X

The plugin is hosted at the central IntelliJ plugin repository. The easiest way to install is to go to File » Settings » Plugins in IntelliJ and use the built-in interface for installing. The plugin name is JRebel Plugin (formerly JavaRebel). If you have previously installed the older JavaRebelIdeaDebuggerPlugin please uninstall it. You can check out the plugin page for more information about the releases of the plugin.


JRebel Plugin installation


Since JRebel installation is done independently from the plug-in installation, one should point IntelliJ plug-in to jrebel.jar explicitly. Go to Settings » JRebel » JRebel location and browse to the jrebel.jar location on your filesystem (it's %REBEL_HOME%\jrebel.jar).


Specify jrebel.jar location


There are also some tweaks to be done in the debugger settings:

2.6 NetBeans 7.x

The plugin is hosted in NetBeans plugins repository at. http://plugins.netbeans.org. Open the Plugins menu from the Tools top menu.



From the opened window, navigate to the Available Plugins tab, select the checkbox for the JRebel plugin and click Install button.



Hit Next button to proceed with the installation until you reach the dialog screen suggesting the a restart.

The plugins comes with the latest stable version of JRebel bundled with the plugin so you are all set after the IDE restarts.

2.7 Oracle JDeveloper

Currently, JRebel doesn't have a dedicated plug-in for Oracle JDeveloper. Luckily, JRebel is IDE-agnostic, so it doesn't actually matter which IDE you use - the plug-ins are provided just to make the things more comfortable. Proceed to Application Configuration how to enable JRebel for an application, and refer to Server Configuration to learn how to enable JRebel agent for the application server of your choice.

3. Application Configuration

3.1 rebel.xml Basics
3.2 Eclipse
3.3 MyEclipse 9.1 or later
3.4 IntelliJ IDEA 8.x/9.x
3.5 IntelliJ IDEA X or later
3.6 NetBeans 7.x
3.7 Maven
3.8 rebel.xml Reference
3.8.1 <application>
3.8.2 <classpath>
3.8.3 <dir>
3.8.4 <dirset>
3.8.5 <jar>
3.8.6 <jarset>
3.8.7 <war>
3.8.8 <web>
3.8.9 <link>
3.8.10 <include>
3.8.11 <exclude>

3.1 rebel.xml Basics

JRebel maps your project workspace directly to a running application, watches for the changes you make to classes and resources, and intelligently reflects them in your application. In order for it to do that, JRebel needs to know where your classes and resources are. We use the rebel.xml configuration file to map your deployed project back to your workspace. This is mandatory when you deploy your app as a WAR/EAR. You'll need to have one rebel.xml file per each module. This includes both web and EJB modules.

The rebel.xml configuration file should end up 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 or a jar library. Put it in the root of a source or resource folder in your project (the same place where the .properties files are) and make sure it's copied to the target directory.

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 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 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 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.

Using Relative Paths

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 property that you provide. You can set this property as a Java System property (-Dmyproject.root=c:/projects/) or in the JRebel Agent Configuration:


Tips and Tricks

3.2 Eclipse

Click on your project and pick Generate rebel.xml.



You need to generate one rebel.xml file per Eclipse project in your workspace; this includes all Java projects, including Web and EJB projects. Put a rebel.xml in the root of a source folder(*) in each project, and Eclipse will copy the rebel.xml file to the expected target folder when the project builds. For Web projects, JRebel expects to find the rebel.xml configuration file in the WEB-INF/classes directory in the target .war file. For EJB and Java projects, JRebel expects the rebel.xml file to be in the jar root.


(*) Put rebel.xml in the root of the src/main/resources folder for Maven projects.

The plugin generates the rebel.xml with absolute paths to your workspace. This 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 property that you provide. You can set this property as a Java System property (-Dmyproject.root=c:/projects/) or in the JRebel Agent Configuration:


If everyone on your team uses Eclipse and a similar workspace layout, you can even skip using a custom property as every application or server launched with JRebel for Eclipse will have the property rebel.workspace.path set to the Eclipse workspace location and you can use it as “${rebel.workspace.path}” in rebel.xml.

3.3 MyEclipse 9.1 or later

Click on your project and pick Generate rebel.xml.



You need to generate one rebel.xml file per Eclipse project in your workspace; this includes all Java projects, including Web and EJB projects. Put a rebel.xml in the root of a source folder(*) in each project, and Eclipse will copy the rebel.xml file to the expected target folder when the project builds. For Web projects, JRebel expects to find the rebel.xml configuration file in the WEB-INF/classes directory in the target .war file. For EJB and Java projects, JRebel expects the rebel.xml file to be in the jar root.


(*) Put rebel.xml in the root of the src/main/resources folder for Maven projects.

The plugin generates the rebel.xml with absolute paths to your workspace. This 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 property that you provide. You can set this property as a Java System property (-Dmyproject.root=c:/projects/) or in the JRebel Agent Configuration:


If everyone on your team uses Eclipse and a similar workspace layout, you can even skip using a custom property as every application or server launched with JRebel for Eclipse will have the property rebel.workspace.path set to the Eclipse workspace location and you can use it as “${rebel.workspace.path}” in rebel.xml.

3.4 IntelliJ IDEA 8.x/9.x

To generate the rebel.xml file right click on your project and pick Generate rebel.xml:

Generate rebel.xml

You need to generate one rebel.xml file per project in your workspace; this includes all Java projects, including Web and EJB projects. Put a rebel.xml in the root of a source folder(*) in each project, and your IDE will copy the rebel.xml file to the expected target folder when the project builds. For Web projects, JRebel expects to find the rebel.xml configuration file in the WEB-INF/classes directory in the target .war file. For EJB and Java projects, JRebel expects the rebel.xml file to be in the jar root.

(*) Put rebel.xml in the root of the src/main/resources folder for Maven projects.

The plugin generates the rebel.xml with absolute paths to your workspace. This 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 property that you provide. You can set this property as a Java System property (-Dmyproject.root=c:/projects/) or in the JRebel Agent Configuration:


3.5 IntelliJ IDEA X or later

To generate the rebel.xml file right click on your project and pick Generate rebel.xml:

Generate rebel.xml

You need to generate one rebel.xml file per project in your workspace; this includes all Java projects, including Web and EJB projects. Put a rebel.xml in the root of a source folder(*) in each project, and your IDE will copy the rebel.xml file to the expected target folder when the project builds. For Web projects, JRebel expects to find the rebel.xml configuration file in the WEB-INF/classes directory in the target .war file. For EJB and Java projects, JRebel expects the rebel.xml file to be in the jar root.

(*) Put rebel.xml in the root of the src/main/resources folder for Maven projects.

The plugin generates the rebel.xml with absolute paths to your workspace. This 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 property that you provide. You can set this property as a Java System property (-Dmyproject.root=c:/projects/) or in the JRebel Agent Configuration:


3.6 NetBeans 7.x



To generate the rebel.xml file right click on your project and pick Generate rebel.xml:

Generate rebel.xml

You need to generate one rebel.xml file per project in your workspace; this includes all Java projects, including Web and EJB projects. Put a rebel.xml in the root of a source folder(*) in each project, and your IDE will copy the rebel.xml file to the expected target folder when the project builds. For Web projects, JRebel expects to find the rebel.xml configuration file in the WEB-INF/classes directory in the target .war file. For EJB and Java projects, JRebel expects the rebel.xml file to be in the jar root.

The plugin generates the rebel.xml with absolute paths to your workspace. This 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 property that you provide. You can set this property as a Java System property (-Dmyproject.root=c:/projects/) or in the JRebel Agent Configuration:


3.7 Maven

Add the following snippet to your parent pom.xml. The rebel.xml configuration file will be generated for each individual sub-module of your maven project.

<plugin>
  <groupId>org.zeroturnaround</groupId>
  <artifactId>jrebel-maven-plugin</artifactId>
  <version>1.1.1</version>
  <executions>
    <execution>
      <id>generate-rebel-xml</id>
      <phase>process-resources</phase>
      <goals>
        <goal>generate</goal>
      </goals>
    </execution>
  </executions>
</plugin>

This will generate JRebel configuration file rebel.xml automatically on every build. If you want to generate the rebel.xml manually run mvn jrebel:generate -Drebel.xml.dir=OUTPUT_DIRECTORY (by default OUTPUT_DIRECTORY is target/classes). Adding -Drebel.generate.show=true will print out generated rebel.xml at info level, so you can immediately see what was generated.

By default, the generated rebel.xml contains absolute paths to your workspace. However if you want to deploy the artifacts for your team to use, you will need to make sure that the paths are relative using a configurable custom property.

Assuming that you have the following project structure in directory c:\projects\:

my-maven-project1
  my-jar1
  my-war1

You should add the following configuration to the plugin:

<configuration>
  <!--
    root is 2 directories up from the jar/war modules
  -->
  <relativePath>../../</relativePath>
  <!--
    use a custom property for specifying root directory (note the double $)
    set the property in JRebel configuration or as -Dmyproject.root=c:/projects/
  -->
  <rootPath>$${myproject.root}</rootPath>
</configuration>

Now you will have c:/projects/my-maven-project1/my-jar1/target/classes as ${myproject.root}/my-maven-project1/my-jar1/target/classes in the rebel.xml. You can set this property as a Java System property (-Dmyproject.root=c:/projects/) or in the JRebel Agent Configuration:

A sample maven plugin configuration with comments follows:

<plugin>
  <groupId>org.zeroturnaround</groupId>
  <artifactId>jrebel-maven-plugin</artifactId>
  <version>1.1.1</version>
  <configuration>
    <!--
     If your project uses custom packaging that is not recognized
     set this to jar or war.
     -->
    <packaging>war</packaging>
    <classpath>
      <fallback>default</fallback>
      <resources>
        <resource>
          <!--
            A relative path.
          -->
          <directory>target/special-classes
          </directory>
          <!--
            You may use includes and excludes as with any other
            resource.
          -->
          <includes>
            <include>com/yourapp/include/package1/**
            </include>
            <include>com/yourapp/include/package2/**
            </include>
          </includes>
          <excludes>
            <exclude>com/yourapp/exclude/package1/**
            </exclude>
            <exclude>com/yourapp/exclude/package2/**
            </exclude>
          </excludes>
        </resource>
        <resource>
          <!--
            Empty resource element marks default configuration. By
            default it is placed first in generated configuration.
          -->
        </resource>
        <resource>
          <!--
            An absoulte path is used here.
           -->
          <jar>c:\projects\myProject\3rdpartyLibs\myLibrary.jar
          </jar>
        </resource>
        <resource>
          <jarset>app/3rd-party-lib</jarset>
          <excludes>
            <exclude>apache*.jar</exclude>
          </excludes>
        </resource>
        <resource>
          <dirset>c:\projects\project1Root\
          </dirset>
          <excludes>
            <exclude>**\build\classes</exclude>
          </excludes>
        </resource>
      </resources>
    </classpath>

    <war>
      <path>c:\projects\myProject\dist\myProject.war
      </path>
    </war>

    <web>
      <resources>
        <resource>
          <target>gfx/</target>
          <directory>c:\projects\myProject\static\gfx
          </directory>
        </resource>
        <resource>
          <!--
            Empty resource element marks default configuration. By
            default it is placed first in generated configuration.
          -->
        </resource>
      </resources>
    </web>


    <!--
      addResourcesDirToRebelXml - default is false
      Required if the resource directories are to be added to rebel.xml
    -->
    <addResourcesDirToRebelXml>true</addResourcesDirToRebelXml>


    <!--
      alwaysGenerate - default is false
      If 'false' - rebel.xml is generated if timestamps of pom.xml and the current rebel.xml file are not equal.
      If 'true' - rebel.xml will always be generated
    -->
    <alwaysGenerate>true</alwaysGenerate>

  </configuration>
</plugin>

Also, maven has a notion of build profiles defined in your application's POM that you can leverage.

    <profiles>                                                     
      <profile>                                                    
        <id>jrebel</id>                               
        <activation>                                               
          <property>                                               
            <name>env</name>                          
            <value>jrebel</value>                     
          </property>                                              
        </activation>                                              
        <build>                                                    
          <plugins>                                                
            <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>                                            
          </plugins>                                             
        </build>                                                 
      </profile>                                                 
    </profiles>                                                  

Executing the example above with mvn -Denv=jrebel clean installcommand will trigger JRebel plugin to generate rebel.xml.

3.8 rebel.xml Reference

Starting with JRebel 2.0 rebel.xml file must be used for web applications that use packaged deployment (i.e. WARs, JARs and EARs). Instead of the WAR/JAR/EAR file deployed all resources will be picked up from the locations provided in the rebel.xml. Also these directories and archives will be monitored for changes.

The rebel.xml must be placed in the WEB-INF/classes directory of the deployed WAR file, in a root directory of a JAR file or in the root of EJB JAR modules. A rebel.xml file should be provided per each module in the application that you want to change on-the-fly.

The contents of the rebel.xml is defined by the schema at http://www.zeroturnaround.com/alderaan/rebel-2_0.xsd . There is a full example at the end of this file.

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.

Tags reference

3.8.1 <application>

Top level tag that defines the configuration with classpath, web and war tags.
<?xml version="1.0" encoding="ISO-8859-1"?>
<application
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.zeroturnaround.com"
xsi:schemaLocation="http://www.zeroturnaround.com http://www.zeroturnaround.com/alderaan/rebel-2_0.xsd">
...
</application>

3.8.2 <classpath>

Defines the mounted classpath of the application with nested dir, dirset, jar and jarset elements. The fallback attribute controls if classes and resources are also found from the original application classpath (e.g. WEB-INF/classes, WEB-INF/lib/*.jar, JAR root, etc).

Attribute Description Required
fallback Values: all, none and default (default).
  • If set to all classes and resources will always be found from both the original and mounted classpath. This mode may cause some resources to appear double in the application.
  • If set to none classes and resources will only be found from the mounted classpath. This mode requires all classes and resources (including e.g. those in WEB-INF/lib/*.jar) to be fully mounted
  • If set to default then classes and resources will be found from both original and mounted classpath, but resources present in both will be filtered out. This mode implies that classes and resources in the path that rebel.xml is in are fully present in the mounted classpath (e.g. all classes and resources in WEB-INF/classes should be mounted if rebel.xml is there).
No
<?xml version="1.0" encoding="ISO-8859-1"?>
<application
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.zeroturnaround.com"
xsi:schemaLocation="http://www.zeroturnaround.com http://www.zeroturnaround.com/alderaan/rebel-2_0.xsd">
<classpath>
...
</classpath>
</application>

3.8.3 <dir>

Directory on the filesystem that is added to classpath or link. Nested include / exclude tags can be used to limit the files included from the specified directory.

Attribute Description  Required
name A full path to a directory on the filesystem.
Yes
includes Specifies a pattern that directs which resources will be included from the parent. No
excludes Specifies a pattern that directs which resources will be excluded from the parent. No
<?xml version="1.0" encoding="ISO-8859-1"?>
<application
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.zeroturnaround.com"
xsi:schemaLocation="http://www.zeroturnaround.com http://www.zeroturnaround.com/alderaan/rebel-2_0.xsd">
<classpath>
<!--
Add a directory with class files to the classpath. The classes
can also be excluded or included based on patterns.
-->
<dir name="c:\projects\myProject\classes\">
<!-- Including everything from com/yourapp/package1-->
<include name="com/yourapp/package1/**"/>
<!-- Exclude the unimportant subpackage of package1-->
<exclude name="com/yourapp/package1/unimportant/**"/>
</dir>
</classpath>
</application>

3.8.4 <dirset>

Defines multiple subdirectories of a directory that can be added to classpath. Nested include / exclude tags can be used to limit the subdirectories included from the specified directory.

Attribute Description Required
dir The parent directory from which subdirectories are found. By default all will be added.  Yes
includes Specifies a pattern that directs which resources will be included from the parent. No
excludes Specifies a pattern that directs which resources will be excluded from the parent. No
<?xml version="1.0" encoding="ISO-8859-1"?>
<application
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.zeroturnaround.com"
xsi:schemaLocation="http://www.zeroturnaround.com http://www.zeroturnaround.com/alderaan/rebel-2_0.xsd">
<classpath>
<!--
DIRSET enables you to add multiple directories to the classpath
without specifying them one-by-one. For example if there are multiple
MAVEN modules with a similar folder structure. The following configuration
will include all modules from the directory of "c:\projects\project1Root\
that adhere to the pattern "**\build\classes".
-->
<dirset dir="c:\projects\project1Root\">
<include name="**\build\classes"/>
</dirset>
</classpath>
</application>

3.8.5 <jar>

Defines a JAR file that is added to classpath or link. Nested include / exclude tags can be used to limit the resources included from the specified JAR.

Attribute Description Required
name Full path to a JAR file that is added to the CLASSPATH. Yes
includes Specifies a pattern that directs which resources will be included from the parent. No
excludes Specifies a pattern that directs which resources will be excluded from the parent. No
<?xml version="1.0" encoding="ISO-8859-1"?>
<application
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.zeroturnaround.com"
xsi:schemaLocation="http://www.zeroturnaround.com http://www.zeroturnaround.com/alderaan/rebel-2_0.xsd">
<classpath>
<!--
Adds a JAR file to the classpath. The classes from the
JAR archive can also be excluded or included based on patterns.
-->
<jar name="c:\projects\myProject\3rdpartyLibs\myLibrary.jar">
<!-- Including everything from com/yourapp/package1-->
<include name="com/yourapp/package1/**"/>
<!-- Exclude the unimportant subpackage of package1-->
<exclude name="com/yourapp/package1/unimportant/**"/>
</jar>
</classpath>
</application>

3.8.6 <jarset>

Defines multiple JAR files to be added to classpath. Nested include / exclude tags can be used to limit the JARS included from the specified directory.

Attribute Description Required
dir JAR files from this directory on the filesystem are added to the CLASSPATH Yes
includes Specifies a pattern that directs which resources will be included from the parent. No
excludes Specifies a pattern that directs which resources will be excluded from the parent. No
<?xml version="1.0" encoding="ISO-8859-1"?>
<application
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.zeroturnaround.com"
xsi:schemaLocation="http://www.zeroturnaround.com http://www.zeroturnaround.com/alderaan/rebel-2_0.xsd">
<classpath>
<!--
JARSET enables you to add multiple JAR files to the classpath without
specifying them one-by-one. The following example includes JAR files
from the app/3rd-party-lib directory that don't match the pattern apache*.jar.
-->
<jarset dir="app/3rd-party-lib">
<exclude name="apache*.jar"/>
</jarset>
</classpath>
</application>

3.8.7 <war>

Overrides the WAR file deployed to the container with a exploded directory or a WAR file on the filesystem. Needs to have either dir or file attribute.

Attribute Description Required
dir Path to an exploded WAR directory on the filesystem. Resources and class files will be loaded from this directory.
Yes/No
file Path to a WAR archive on the filesystem. Resources and class files will be loaded from this file. Yes/No
<?xml version="1.0" encoding="ISO-8859-1"?>
<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">
<!--
WAR tag with FILE attribute specifies the location of the WAR file.
The contents of this WAR file will have higher priority as compared
to the web application deployed. All resources in this file will be
available in the web application just as they would be in the
deployed WAR file.
-->
<war file="c:\projects\myProject\dist\myProject.war" />
</application>
<?xml version="1.0" encoding="ISO-8859-1"?>
<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">
<!--
WAR tag with DIR attribute specifies the location of the exploded
directory. The contents of this directory will have higher priority
as compared to the web application deployed to the container. All
resources in this folder will be available in the web application
just as they would be in the deployed web application.
-->
<war dir="c:\projects\myProject\dist\war" />
</application>

3.8.8 <web>

Defines separate locations for static resources that can be referenced from the web application. With nested link tags it is possible to map different resources from the filesystem to the web context.

<?xml version="1.0" encoding="ISO-8859-1"?>
<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">
<!--
WEB tag defines separate locations for static resources that can be referenced from
the web application. Directories containing jsp, css, html, gif etc. files. These
directories can be mapped to arbitrary locations for the web application.
-->
<web>
...
</web>
</application>

3.8.9 <link>

Can be added to web to link a nested dir or jar to the target URI. The mapped resource is made available from servlet context and also via HTTP.

Attribute Description Required
target Mapping target. For example "gfx/" or "js/". Yes
<?xml version="1.0" encoding="ISO-8859-1"?>
<application
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.zeroturnaround.com"
xsi:schemaLocation="http://www.zeroturnaround.com http://www.zeroturnaround.com/alderaan/rebel-2_0.xsd">
<!--
WEB tag defines separate locations for static resources that can be referenced from
the web application. Directories containing jsp, css, html, gif etc. files. These
directories can be mapped to arbitrary locations for the web application.
-->
<web>
<!--
The location c:\projects\myProject\static\gfx will be accessible to the WEB
application as http://yourhost/webapp/gfx folder. Adding static resources to
that location will let you use them from your web application.
-->
<link target="gfx/">
<dir name="c:\projects\myProject\static\gfx"/>
</link>
</web>
</classpath>
</application>

3.8.10 <include>

This element is used to filter resources in dir, dirset, jar and jarset elements. Resources named by this element will be included in the result. This element uses Ant-style patterns.

Attribute Description Required
name Name that will be filtered, can contain wildcards. See example for more information. Yes
<dirset dir="c:\projects\project1Root\">
<exclude name="**\build\classes"/>
</dirset>
...
<jarset dir="app/3rd-party-lib">
<exclude name="apache*.jar"/>
</jarset>
...
<jar name="c:\projects\myProject\3rdpartyLibs\myLibrary.jar">
<!-- Include all of package1-->
<include name="com/yourapp/package1/**"/>
<!-- Except for internal subpackage-->
<exclude name="com/yourapp/package1/internal/**"/>
</jar>

3.8.11 <exclude>

This element is used to filter resources in dir, dirset, jar and jarset elements. Resources named by this element will be excluded from the result. This element uses Ant-style patterns.

Attribute Description Required
name Name that will be filtered, can contain wildcards. See example from include tag for more information. Yes

Example configuration

The following file can be copied to your project and appropriate sections deleted or customized.

<?xml version="1.0" encoding="ISO-8859-1"?>
<application
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.zeroturnaround.com"
xsi:schemaLocation="http://www.zeroturnaround.com http://www.zeroturnaround.com/alderaan/rebel-2_0.xsd">

<!--
Classpath allows you to add DIRECTORIES and JAR files to your classpath. Your
webapp will see these resources as resources inside the WAR archive or your
exploded directory.
The default value of fallback is true. When set to 'false' then if a resources
is NOT found from the defined directories, it won't be looked for from the
deployed resources.
Example. Fallback is set to FALSE and you remove a styles.css file. Even though
a styles.css file is deployed to the container, it will give a 404 on HTTP request
or null on ServletContext lookup even though it exists in the deployed archive.
If set to true, all resources will fallback to the deployed application, this is
the default behavior.
-->
<classpath fallback="default">
<!--
Add a directory with class files to the classpath. The classes
can also be excluded or included based on patterns.
-->
<dir name="c:\projects\myProject\classes\">
<!-- Only include package1 and its subpackages -->
<include name="com/yourapp/package1/**"/>
<!-- Except com/yourapp/package1/package2 and its subpackages -->
<exclude name="com/yourapp/package1/package2/**"/>
</dir>
<!--
Adds a JAR file to the classpath. The classes from the
JAR archive can also be excluded or included based on patterns.
-->
<jar name="c:\projects\myProject\3rdpartyLibs\myLibrary.jar">
<!-- Only include package1 and its subpackages -->
<include name="com/yourapp/package1/**"/>
<!-- Except com/yourapp/package1/package2 and its subpackages -->
<exclude name="com/yourapp/package1/package2/**"/>
</jar>
<!--
JARSET enables you to add multiple JAR files to the classpath without
specifying them one-by-one. The following example includes JAR files
from the c:\projects\3rd-party-lib directory that don't match the pattern apache*.jar.
-->
<jarset dir="c:\projects\3rd-party-lib">
<exclude name="apache*.jar"/>
</jarset>
<!--
DIRSET enables you to add multiple directories to the classpath
without specifying them one-by-one. For example if there are multiple
MAVEN modules with a similar folder structure. The following configuration
will include all modules from the directory of "c:\projects\project1Root\
that adhere to the pattern "**\build\classes".
-->
<dirset dir="c:\projects\project1Root\">
<exclude name="**\build\classes"/>
</dirset>
</classpath>
<!--
WAR tag with FILE attribute specifies the location of the WAR file. The contents
of this WAR file will have higher priority as compared to the web application deployed.
All resources in this file will be available in the web application just as they
would be in the deployed WAR file.
-->
<war file="c:\projects\myProject\dist\myProject.war" />

<!--
WAR tag with DIR attribute specifies the location of the exploded directory. The
contents of this directory will have higher priority as compared to the web application
deployed to the container. All resources in this folder will be available in the
web application just as they would be in the deployed web application.
-->
<war dir="c:\projects\myProject\dist\war"/>


<!--
WEB tag defines separate locations for static resources that can be referenced from
the web application. Directories containing jsp, css, html, gif etc. files. These
directories can be mapped to arbitrary locations for the web application.
-->
<web>
<!--
The location c:\projects\myProject\static\gfx will be accessible to the WEB
application as http://yourhost/webapp/gfx folder. Adding static resources to
that location will let you use them from your web application.
-->
<link target="gfx/">
<dir name="c:\projects\myProject\static\gfx"/>
</link>
<!--
The location c:\projects\jsProject\dist\js will be accessible to the WEB
application as http://yourhost/webapp/js folder. Adding static resources to
that location will let you use them from your web application.
-->
<link target="js/">
<dir name="c:\projects\jsProject\dist\js"/>
</link>
</web>
</application>

4. Server Configuration

4.1 Quick Start
4.2 Eclipse
4.3 MyEclipse 9.1 or later
4.4 IntelliJ IDEA 8.x, 9.x
4.5 IntelliJ IDEA X or later
4.6 Java 5.x or later (Sun or JRockit JVM)
4.6.1 Standalone Applications on Windows
4.6.2 Standalone Applications on Linux/Mac OS X
4.6.3 Apache Geronimo on Windows
4.6.4 Apache Geronimo on Linux/Mac OS X
4.6.5 Google App Engine 1.x on Windows
4.6.6 Google App Engine 1.x on Linux/Mac OS X
4.6.7 Google Web Toolkit on Windows
4.6.8 Google Web Toolkit on Linux/Mac OS X
4.6.9 GlassFish V2, V3 on Windows
4.6.10 GlassFish V2, V3 on Linux/Mac OS X
4.6.11 JBoss 4.x, 5.x, 6.x on Windows
4.6.12 JBoss 4.x, 5.x, 6.x on Linux/Mac OS X
4.6.13 JBoss 7.x on Windows
4.6.14 JBoss 7.x on Linux/Mac OS X
4.6.15 Jetty 5.x, 6.x, 7.x on Windows
4.6.16 Jetty 5.x, 6.x, 7.x on Linux/Mac OS X
4.6.17 Jetty 8.x on Windows
4.6.18 Jetty 8.x on Linux/Mac OS X
4.6.19 Maven Jetty plugin (mvn jetty:run) on Windows
4.6.20 Maven Jetty plugin (mvn jetty:run) on Linux/Mac OS X
4.6.21 Oracle Application Server 10.x on Windows
4.6.22 Oracle Application Server 10.x on Linux/Mac OS X
4.6.23 Oracle Application Server 9.x on Windows
4.6.24 Oracle Application Server 9.x on Linux/Mac OS X
4.6.25 Caucho Resin 3.1.x, 4.x on Windows
4.6.26 Caucho Resin 3.1.x, 4.x on Linux/Mac OS X
4.6.27 Caucho Resin 3.0.x on Windows
4.6.28 Caucho Resin 3.0.x on Linux/Mac OS X
4.6.29 SAP NetWeaver 7.1.x on Windows
4.6.30 SAP NetWeaver 7.1.x on Linux/Mac OS X
4.6.31 SpringSource dm Platform (Eclipse Virgo) on Windows
4.6.32 SpringSource dm Platform (Eclipse Virgo) on Linux/Mac OS X
4.6.33 Spring tc Server on Windows
4.6.34 Spring tc Server on Linux/Mac OS X
4.6.35 Tomcat 4.x, 5.x, 6.x, 7.x on Windows
4.6.36 Tomcat 4.x, 5.x, 6.x, 7.x on Linux/Mac OS X
4.6.37 MuleSoft TCat on Windows
4.6.38 MuleSoft TCat on Linux/Mac OS X
4.6.39 Oracle Weblogic 9.x, 10.x, 12.x on Windows
4.6.40 Oracle Weblogic 9.x, 10.x, 12.x on Linux/Mac OS X
4.6.41 IBM WebSphere AS CE on Windows
4.6.42 IBM WebSphere AS CE on Linux/Mac OS X
4.6.43 Other on Windows
4.6.44 Other on Linux/Mac OS X
4.7 Java 1.4.x (Sun or JRockit JVM)
4.7.1 Standalone Applications on Windows
4.7.2 Standalone Applications on Linux/Mac OS X
4.7.3 JBoss 4.x on Windows
4.7.4 JBoss 4.x on Linux/Mac OS X
4.7.5 Jetty 5.x, 6.x on Windows
4.7.6 Jetty 5.x, 6.x on Linux/Mac OS X
4.7.7 Maven Jetty plugin (mvn jetty:run) on Windows
4.7.8 Maven Jetty plugin (mvn jetty:run) on Linux/Mac OS X
4.7.9 Oracle Application Server 10.x on Windows
4.7.10 Oracle Application Server 10.x on Linux/Mac OS X
4.7.11 Oracle Application Server 9.x on Windows
4.7.12 Oracle Application Server 9.x on Linux/Mac OS X
4.7.13 Caucho Resin 3.0.x on Windows
4.7.14 Caucho Resin 3.0.x on Linux/Mac OS X
4.7.15 SAP NetWeaver 7.0.x on Windows
4.7.16 SAP NetWeaver 7.0.x on Linux/Mac OS X
4.7.17 Tomcat 4.x, 5.0.x on Windows
4.7.18 Tomcat 4.x, 5.0.x on Linux/Mac OS X
4.7.19 Oracle Weblogic 7.x, 8.x on Windows
4.7.20 Oracle Weblogic 7.x, 8.x on Linux/Mac OS X
4.8 IBM JVM (Java 1.4.x or later)
4.8.1 IBM WebSphere 6.0.x, 6.1.x, 7.x on Windows
4.8.2 IBM WebSphere 6.0.x, 6.1.x, 7.x on Linux/Mac OS X
4.8.3 Other servers or applications using IBM JDK on Windows
4.8.4 Other servers or applications using IBM JDK on Linux/Mac OS X

4.1 Quick Start

Make sure that your IDE compiles Java classes to the same location where JRebel reads 'em from.

4.2 Eclipse

Automatic publishing should be disabled in the server configuration. Double click on your server name and a configuration page opens. Under the Publish section you should have the Never publish automatically option selected as shown in the following screenshot below. To start the server with JRebel enabled, check the corresponding checkbox (Enable JRebel agent) in JRebel Integration section.


wtp-server


If you run a standalone application you can enable JRebel for its launch configuration.


launch

4.3 MyEclipse 9.1 or later

To start the server with JRebel enabled, check the corresponding checkbox (Enable JRebel agent) in JRebel settings section.


myeclipse-server


If you run a standalone application you can enable JRebel for its launch configuration.


launch

4.4 IntelliJ 8.x, 9.x

This plugin introduces new launch buttons. One for starting the container with JRebel and the other for starting the container in debug mode with JRebel enabled.


Launching container with JavaRebel


4.5 IntelliJ X or later

This plugin introduces new launch buttons. One for starting the container with JRebel and the other for starting the container in debug mode with JRebel enabled.


Launching container with JavaRebel


4.6 Java 5.x or later (Sun or JRockit JVM)

4.6.1 Standalone Applications on Windows

Just run as usual adding the integration string:

java -javaagent:%REBEL_HOME%\jrebel.jar MAIN_CLASS ARGS

For instance:

java -javaagent:c:\JRebel\jrebel.jar foo.bar.MyServer

While developing IntelliJ IDEA or Eclipse plugins start the respected testing IDE instance with the integration string.

4.6.2 Standalone Applications on Linux/Mac OS X

Just run as usual adding the integration string:

java -javaagent:$REBEL_HOME/jrebel.jar MAIN_CLASS ARGS

For instance:

java -javaagent:/opt/jrebel/jrebel.jar foo.bar.MyServer

While developing IntelliJ IDEA or Eclipse plugins start the respected testing IDE instance with the integration string.

4.6.3 Apache Geronimo on Windows

Go to %GERONIMO_HOME%\bin and create the file geronimo-jrebel.bat with the following contents:


@echo off
set JAVA_OPTS=-javaagent:%REBEL_HOME%\jrebel.jar -Xms256m -Xmx512m -XX:MaxPermSize=256m %JAVA_OPTS%
call "%~dp0\geronimo.bat" %*

Use this command file instead of geronimo.bat if you want to run Geronimo with JRebel.

> geronimo.bat run

4.6.4 Apache Geronimo on Linux/Mac OS X

Go to $GERONIMO_HOME/bin and create the file geronimo-jrebel.sh with the following contents:


#!/bin/bash
export JAVA_OPTS="-javaagent:$REBEL_HOME/jrebel.jar -Xms256m -Xmx512m -XX:MaxPermSize=256m $JAVA_OPTS"
`dirname $0`/geronimo.sh $@

Use this script instead of geronimo.sh if you want to run Geronimo with JRebel.

> geronimo.sh run

4.6.5 Google App Engine 1.x on Windows

File: %GAE_HOME%\bin\dev_appserver.cmd

Add the following line after com.google.appengine.tools.KickStart:

--jvm_flag=-javaagent:%REBEL_HOME%\jrebel.jar ^

4.6.6 Google App Engine 1.x on Linux/Mac OS X

File: $GAE_HOME/bin/dev_appserver.sh

Add the following line after com.google.appengine.tools.KickStart:

--jvm_flag=-javaagent:$REBEL_HOME/jrebel.jar \

4.6.7 Google Web Toolkit on Windows

Google Web Toolkit uses Apache Ant to start a web container, either Jetty or Tomcat, along with the GWT application. Thus, to enable JReble for GWT in development mode, one should set ANT_OPTS environment variable accordingly.

Go to the GWT project directory, and create run-jrebel.cmd file with the following content:

    @echo off
    set ANT_OPTS=-javaagent:%REBEL_HOME%\jrebel.jar
    ant devmode

Now use run-jrebel.cmd to run your GWT application in development mode with JRebel enabled.

4.6.8 Google Web Toolkit on Linux/Mac OS X

Google Web Toolkit uses Apache Ant to start a web container, either Jetty or Tomcat, along with the GWT application. Thus, to enable JReble for GWT in development mode, one should set ANT_OPTS environment variable accordingly.

Go to the GWT project directory, and create run-jrebel.sh file with the following content:

    #!/bin/bash
    export ANT_OPTS=-javaagent:$REBEL_HOME/jrebel.jar
    ant devmode

Now use run-jrebel.sh to run your GWT application in development mode with JRebel enabled.

4.6.9 GlassFish V2, V3 on Windows

In the Administration Console open Configuration » JVM Settings » JVM Options

Use the Add JVM Option button to insert the following option:

-javaagent:%REBEL_HOME%\jrebel.jar

Press Save and restart the server.

4.6.10 GlassFish V2, V3 on Linux/Mac OS X

In the Administration Console open Configuration » JVM Settings » JVM Options

Use the Add JVM Option button to insert the following option:

-javaagent:$REBEL_HOME/jrebel.jar

Press Save and restart the server.

4.6.11 JBoss 4.x, 5.x, 6.x on Windows

Go to %JBOSS_HOME%\bin and create the file run-jrebel.cmd with the following contents:


@echo off
set JAVA_OPTS=-javaagent:%REBEL_HOME%\jrebel.jar -Xms256m -Xmx512m -XX:MaxPermSize=256m %JAVA_OPTS%
call "%~dp0\run.bat" %*

Use this command file instead of run.bat if you want to run JBoss with JRebel.

4.6.12 JBoss 4.x, 5.x, 6.x on Linux/Mac OS X

Go to $JBOSS_HOME/bin and create the file run-jrebel.sh with the following contents:


#!/bin/bash
export JAVA_OPTS="-javaagent:$REBEL_HOME/jrebel.jar -Xms256m -Xmx512m -XX:MaxPermSize=256m $JAVA_OPTS"
`dirname $0`/run.sh $@

Use this script instead of run.sh if you want to run JBoss with JRebel.

4.6.13 JBoss 7.x on Windows

Go to %JBOSS_HOME%\bin and create the file standalone-jrebel.cmd with the following contents:


@echo off
set JAVA_OPTS=-javaagent:%REBEL_HOME%\jrebel.jar -Xms256m -Xmx512m -XX:MaxPermSize=256m %JAVA_OPTS%
call "%~dp0\standalone.bat" %*

Use this command file instead of standalone.bat if you want to run JBoss with JRebel.

4.6.14 JBoss 7.x on Linux/Mac OS X

Go to $JBOSS_HOME/bin and create the file standalone-jrebel.sh with the following contents:


#!/bin/bash
export JAVA_OPTS="-javaagent:$REBEL_HOME/jrebel.jar -Xms256m -Xmx512m -XX:MaxPermSize=256m $JAVA_OPTS"
`dirname $0`/standalone.sh $@

Use this script instead of standalone.sh if you want to run JBoss with JRebel.

4.6.15 Jetty 5.x, 6.x, 7.x on Windows

Since Jetty does not have any startup scripts for Windows just add the following line to the command line:

 -javaagent:%REBEL_HOME%\jrebel.jar

4.6.16 Jetty 5.x, 6.x, 7.x on Linux/Mac OS X

The newer Jetty distributions (starting from 6.x) come with the bin/jetty.sh script in the Jetty's installation directory.

Go to $JETTY_HOME/bin and create the file run-jrebel.sh with the following contents:


#!/bin/bash
export JAVA_OPTS="-javaagent:$REBEL_HOME/jrebel.jar -Xms256m -Xmx512m -XX:MaxPermSize=256m $JAVA_OPTS"
`dirname $0`/jetty.sh $@

Use this script instead of jetty.sh if you want to run Jetty with JRebel.

4.6.17 Jetty 8.x on Windows

Since Jetty does not have any startup scripts for Windows just add the following line to the command line:

 -javaagent:%REBEL_HOME%\jrebel.jar

4.6.18 Jetty 8.x on Linux/Mac OS X

Go to $JETTY_HOME/bin and create the file jetty-jrebel.sh with the following contents:


#!/bin/bash
export JAVA_OPTIONS="-javaagent:$REBEL_HOME/jrebel.jar -Xms256m -Xmx512m -XX:MaxPermSize=256m $JAVA_OPTIONS"
`dirname $0`/jetty.sh $@

Use this script instead of jetty.sh if you want to run Jetty with JRebel.

4.6.19 Maven Jetty plugin (mvn jetty:run) on Windows

Edit your pom.xml file and set the scanIntervalSeconds param to 0, this will turn off Jetty's internal reloading. It should look like this:
<plugin>
  <groupId>org.mortbay.jetty</groupId>
  <artifactId>jetty-maven-plugin</artifactId>
  <configuration>
    <scanIntervalSeconds>0</scanIntervalSeconds>
  </configuration>
</plugin>

Add the following line to the MAVEN_OPTS environment variable:

-javaagent:%REBEL_HOME%\jrebel.jar

To do it in the console:

  > set MAVEN_OPTS=-javaagent:%REBEL_HOME%\jrebel.jar %MAVEN_OPTS%
  > mvn jetty:run

4.6.20 Maven Jetty plugin (mvn jetty:run) on Linux/Mac OS X

Edit your pom.xml file and set the scanIntervalSeconds param to 0, this will turn off Jetty's internal reloading. It should look like this:
<plugin>
  <groupId>org.mortbay.jetty</groupId>
  <artifactId>jetty-maven-plugin</artifactId>
  <configuration>
    <scanIntervalSeconds>0</scanIntervalSeconds>
  </configuration>
</plugin>

Add the following line to the MAVEN_OPTS environment variable:

-javaagent:$REBEL_HOME/jrebel.jar

To do it in the console:

  > export MAVEN_OPTS="-javaagent:$REBEL_HOME/jrebel.jar $MAVEN_OPTS"
  > mvn jetty:run

4.6.21 Oracle Application Server 10.x on Windows

Go to %ORACLE10_HOME%\bin and create the file run-oc4j.cmd with the following contents:


set OC4J_JVM_ARGS=-javaagent:%REBEL_HOME%\jrebel.jar %OC4J_JVM_ARGS%
call "%~dp0\oc4j.cmd" %*

Use this command file instead of oc4j.cmd if you want to run OC4J with JRebel.

4.6.22 Oracle Application Server 10.x on Linux/Mac OS X

Go to $ORACLE10_HOME/bin and create the file oc4j-jrebel.sh with the following contents:


#!/bin/bash
export OC4J_JVM_ARGS="-javaagent:$REBEL_HOME/jrebel.jar $OC4J_JVM_ARGS"
`dirname $0`/oc4j $@

Use this script instead of oc4j if you want to run OC4J with JRebel.

4.6.23 Oracle Application Server 9.x on Windows

Go to folder %ORACLE9_HOME%\j2ee\home and start the server with the following command:

java -javaagent:%REBEL_HOME%\jrebel.jar -jar oc4j.jar

4.6.24 Oracle Application Server 9.x on Linux/Mac OS X

Go to folder $ORACLE9_HOME/j2ee/home and start the server with the following command:

java -javaagent:$REBEL_HOME/jrebel.jar -jar oc4j.jar

4.6.25 Caucho Resin 3.1.x, 4.x on Windows

To start Resin server with JRebel from %RESIN_HOME% use the following command line:

java -javaagent:%REBEL_HOME%\jrebel.jar -jar lib\resin.jar

4.6.26 Caucho Resin 3.1.x, 4.x on Linux/Mac OS X

Replace the last line of $RESIN_HOME/bin/httpd.sh (or resin.sh in Resin 3.2+) with the following:

exec $JAVA_EXE -javaagent:$REBEL_HOME/jrebel.jar -jar $RESIN_HOME/lib/resin.jar $*

4.6.27 Caucho Resin 3.0.x on Windows

Start httpd.exe with parameters

httpd.exe -J-javaagent:%REBEL_HOME%\jrebel.jar

4.6.28 Caucho Resin 3.0.x on Linux/Mac OS X

Modify $RESIN_HOME/bin/wrapper.pl $JAVA_ARGS variable to include the line:

-javaagent:$REBEL_HOME/jrebel.jar

4.6.29 SAP NetWeaver 7.1.x on Windows

Use Configuration management console to add the following parameters to the JVM:

-javaagent:%REBEL_HOME%\jrebel.jar

4.6.30 SAP NetWeaver 7.1.x on Linux/Mac OS X

Use Configuration management console to add the following parameters to the JVM:

-javaagent:$REBEL_HOME/jrebel.jar

4.6.31 SpringSource dm Platform (Eclipse Virgo) on Windows

Edit files "%PLATFORM_HOME%\lib\java5-platform.profile" and "%PLATFORM_HOME%\lib\java6-platform.profile". Add "com.zeroturnaround.*,\" and "org.zeroturnaround.*,\" to the property "org.osgi.framework.bootdelegation".

File: %PLATFORM_HOME%\bin\startup.bat

Add the following line:

set JAVA_OPTS=-javaagent:%REBEL_HOME%\jrebel.jar %JAVA_OPTS%

4.6.32 SpringSource dm Platform (Eclipse Virgo) on Linux/Mac OS X

Edit files "$PLATFORM_HOME/lib/java5-platform.profile" and "$PLATFORM_HOME/lib/java6-platform.profile". Add "com.zeroturnaround.*,\" and "org.zeroturnaround.*,\" to the property "org.osgi.framework.bootdelegation".

File: $PLATFORM_HOME/bin/startup.sh

Add the following line:

 JAVA_OPTS="-javaagent:$REBEL_HOME/jrebel.jar $JAVA_OPTS"

4.6.33 Spring tc Server on Windows

Go to %SPRING_TC_HOME%, choose the Tomcat instance (%CATALINA_BASE%) you would like to run.

Open the %CATALINA_BASE%\conf\wrapper.conf configuration file for editing.

In the Java Additional Parameters section, add the additional wrapper.java.additional.* properties:

wrapper.java.additional.10=-javaagent:%REBEL_HOME%\jrebel.jar

Use the %SPRING_TC_HOME%\tcruntime-ctl.bat script to start Tomcat instances as usual.

4.6.34 Spring tc Server on Linux/Mac OS X

Go to $SPRING_TC_HOME, choose the Tomcat instance ($CATALINA_BASE) you would like to run.

Open the $CATALINA_BASE/conf/wrapper.conf configuration file for editing.

In the Java Additional Parameters section, add the additional wrapper.java.additional.* properties:

wrapper.java.additional.10=-javaagent:$REBEL_HOME/jrebel.jar

Use the $SPRING_TC_HOME/tcruntime-ctl.bat script to start Tomcat instances as usual.

4.6.35 Tomcat 4.x, 5.x, 6.x, 7.x on Windows

Go to %TOMCAT_HOME%\bin and create the file startup-jrebel.cmd with the following contents:


@echo off
set JAVA_OPTS=-javaagent:%REBEL_HOME%\jrebel.jar %JAVA_OPTS%
call "%~dp0\startup.bat" %*

You can also create a catalina-jrebel.cmd with the following content:


@echo off
set JAVA_OPTS=-javaagent:%REBEL_HOME%\jrebel.jar %JAVA_OPTS%
call "%~dp0\catalina.bat" %*

Use those command files instead of startup.bat and catalina.bat if you want to run Tomcat with JRebel.

If you're running Tomcat as a service please open the tomcatXw.exe wrapper (or double click the Tomcat icon in the system tray) and insert the following line into the Java » Java Options textbox:

-javaagent:%REBEL_HOME%\jrebel.jar

as shown on the following screenshot:

4.6.36 Tomcat 4.x, 5.x, 6.x, 7.x on Linux/Mac OS X

Go to $TOMCAT_HOME/bin and create the file startup-jrebel.sh with the following contents:


#!/bin/bash
export JAVA_OPTS="-javaagent:$REBEL_HOME/jrebel.jar $JAVA_OPTS"
`dirname $0`/startup.sh $@

You can also create a catalina-jrebel.sh with the following content:


#!/bin/bash
export JAVA_OPTS="-javaagent:$REBEL_HOME/jrebel.jar $JAVA_OPTS"
`dirname $0`/catalina.sh $@

Make them executable and use those scripts instead of startup.sh and catalina.sh if you want to run Tomcat with JRebel.

4.6.37 MuleSoft TCat on Windows

Go to %TCAT_HOME%\bin and create the file startup-jrebel.cmd with the following contents:


@echo off
set JAVA_OPTS=-javaagent:%REBEL_HOME%\jrebel.jar %JAVA_OPTS%
call "%~dp0\startup.bat" %*

You can also create a catalina-jrebel.cmd with the following content:


@echo off
set JAVA_OPTS=-javaagent:%REBEL_HOME%\jrebel.jar %JAVA_OPTS%
call "%~dp0\catalina.bat" %*

Use those command files instead of startup.bat and catalina.bat if you want to run TCat with JRebel.

If you're running TCat as a service please open the TcatServerw.exe wrapper (or double click the TCat icon in the system tray) and insert the following line into the Java » Java Options textbox:

-javaagent:%REBEL_HOME%\jrebel.jar

as shown on the following screenshot:

4.6.38 MuleSoft TCat on Linux/Mac OS X

Go to $TCAT_HOME/bin and create the file startup-jrebel.sh with the following contents:


#!/bin/bash
export JAVA_OPTS="-javaagent:$REBEL_HOME/jrebel.jar $JAVA_OPTS"
`dirname $0`/startup.sh $@

You can also create a catalina-jrebel.sh with the following content:


#!/bin/bash
export JAVA_OPTS="-javaagent:$REBEL_HOME/jrebel.jar $JAVA_OPTS"
`dirname $0`/catalina.sh $@

Make them executable and use those scripts instead of startup.sh and catalina.sh if you want to run TCat with JRebel.

4.6.39 Oracle Weblogic 9.x, 10.x, 12.x on Windows

Go to %DOMAIN_HOME%\bin and create the file startWeblogic-jrebel.cmd with the following contents:


@echo off
set JAVA_OPTIONS=-javaagent:%REBEL_HOME%\jrebel.jar %JAVA_OPTIONS%
call "%~dp0\startWebLogic.cmd" %*

Use this command file instead of startWeblogic.cmd if you want to run Weblogic with JRebel.

It is highly recommended to avoid using class caching (CLASS_CACHE=true) because in some cases it may prevent classes and resources from being reloaded.

4.6.40 Oracle Weblogic 9.x, 10.x, 12.x on Linux/Mac OS X

Go to $DOMAIN_HOME/bin and create the file startWeblogic-jrebel.sh with the following contents:


#!/bin/bash
export JAVA_OPTIONS="-javaagent:$REBEL_HOME/jrebel.jar $JAVA_OPTIONS"
`dirname $0`/startWebLogic.sh $@

Use this script instead of startWeblogic.sh if you want to run Weblogic with JRebel.

It is highly recommended to avoid using class caching (CLASS_CACHE=true) because in some cases it may prevent classes and resources from being reloaded.

4.6.41 IBM WebSphere AS CE on Windows

Go to %WEBSPHERE_CE_HOME%\bin and create the file startup-jrebel.bat with the following contents:


@echo off
set JAVA_OPTS=-javaagent:%REBEL_HOME%\jrebel.jar
call "%~dp0\startup.bat" %*

Use this command file instead of startup.bat if you want to run WebSphere CE with JRebel.

4.6.42 IBM WebSphere AS CE on Linux/Mac OS X

Go to $WEBSPHERE_CE_HOME/bin and create the file startup-jrebel.sh with the following contents:


#!/bin/bash
export JAVA_OPTS="-javaagent:$REBEL_HOME/jrebel.jar"
`dirname $0`/startup.sh $@

Use this script instead of startup.sh if you want to run WebSphere CE with JRebel.

4.6.43 Other on Windows

If JRebel doesn't work with your application or container it is most probably due to some custom classloaders that don't behave as we expect them to. You need to determine the class name of the classloader in question. The easiest way to do it is put the following line in any class that will be loaded by that classloader (e.g. in a web application case it could be a servlet class):

System.out.println(getClass().getClassLoader().getClass().getName());

This will print the name of the classloader class right out to the console. Let's assume the name was "com.acme.CustomClassLoader". In that case all we need to do is pass it to the JRebel agent like this:

-javaagent:%REBEL_HOME%\jrebel.jar=com.acme.CustomClassLoader

Sometimes there could be several different custom classloaders and in such a case a comma-separated syntax should be used:

-javaagent:%REBEL_HOME%\jrebel.jar=com.acme.CustomClassLoader1,com.acme.CustomClassLoader2,...

This should get most of the custom classloaders to work.

4.6.44 Other on Linux/Mac OS X

If JRebel doesn't work with your application or container it is most probably due to some custom classloaders that don't behave as we expect them to. You need to determine the class name of the classloader in question. The easiest way to do it is put the following line in any class that will be loaded by that classloader (e.g. in a web application case it could be a servlet class):

System.out.println(getClass().getClassLoader().getClass().getName());

This will print the name of the classloader class right out to the console. Let's assume the name was "com.acme.CustomClassLoader". In that case all we need to do is pass it to the JRebel agent like this:

-javaagent:$REBEL_HOME/jrebel.jar=com.acme.CustomClassLoader

Sometimes there could be several different custom classloaders and in such a case a comma-separated syntax should be used:

-javaagent:$REBEL_HOME/jrebel.jar=com.acme.CustomClassLoader1,com.acme.CustomClassLoader2,...

This should get most of the custom classloaders to work.

4.7 Java 1.4.x (Sun or JRockit JVM)

4.7.1 Standalone Applications on Windows

Run java -jar %REBEL_HOME%\jrebel.jar to generate the jrebel-bootstrap.jar using the JVM you will run the application with.

Add this arguments to the JVM command line:

java -noverify -Xbootclasspath/p:%REBEL_HOME%\jrebel-bootstrap.jar;%REBEL_HOME%\jrebel.jar MAIN_CLASS ARGS

4.7.2 Standalone Applications on Linux/Mac OS X

Run java -jar $REBEL_HOME/jrebel.jar to generate the jrebel-bootstrap.jar using the JVM you will run the application with.

Add this arguments to the JVM command line:

java -noverify -Xbootclasspath/p:$REBEL_HOME/jrebel-bootstrap.jar;$REBEL_HOME/jrebel.jar MAIN_CLASS ARGS

4.7.3 JBoss 4.x on Windows

Go to %JBOSS_HOME%\bin and create the file run-jrebel.cmd with the following contents:


@echo off
set JREBEL_BOOTSTRAP="%~dp0\jrebel-bootstrap.jar"
java -Drebel.bootstrap=%JREBEL_BOOTSTRAP% -jar %REBEL_HOME%\jrebel.jar  
set JAVA_OPTS=-noverify -Xbootclasspath/p:%JREBEL_BOOTSTRAP%;%REBEL_HOME%\jrebel.jar %JAVA_OPTS%
call "%~dp0\run.bat" %*

Use this command file instead of run.bat if you want to run JBoss with JRebel.

4.7.4 JBoss 4.x on Linux/Mac OS X

Go to $JBOSS_HOME/bin and create the file run-jrebel.sh with the following contents:


#!/bin/bash
JREBEL_BOOTSTRAP=`dirname $0`/jrebel-bootstrap.jar
java -Drebel.bootstrap=$JREBEL_BOOTSTRAP -jar $REBEL_HOME/jrebel.jar
export JAVA_OPTS="-noverify -Xbootclasspath/p:$JREBEL_BOOTSTRAP:$REBEL_HOME/jrebel.jar $JAVA_OPTS"
`dirname $0`/run.sh $@

Use this script instead of run.sh if you want to run JBoss with JRebel.

4.7.5 Jetty 5.x, 6.x on Windows

Run java -jar %REBEL_HOME%\jrebel.jar to generate the jrebel-bootstrap.jar using the JVM you will run the application with.

Add the following line to the JVM command line:

-noverify -Xbootclasspath/p:%REBEL_HOME%\jrebel-bootstrap.jar;%REBEL_HOME%\jrebel.jar

4.7.6 Jetty 5.x, 6.x on Linux/Mac OS X

Run java -jar $REBEL_HOME/jrebel.jar to generate the jrebel-bootstrap.jar using the JVM you will run the application with.

Add the following line to the JVM command line:

-noverify -Xbootclasspath/p:$REBEL_HOME/jrebel-bootstrap.jar;$REBEL_HOME/jrebel.jar

4.7.7 Maven Jetty plugin (mvn jetty:run) on Windows

Edit your pom.xml file and set the scanIntervalSeconds param to 0, this will turn off Jetty's internal reloading. It should look like this:
<plugin>
  <groupId>org.mortbay.jetty</groupId>
  <artifactId>jetty-maven-plugin</artifactId>
  <configuration>
    <scanIntervalSeconds>0</scanIntervalSeconds>
  </configuration>
</plugin>

Run java -jar %REBEL_HOME%\jrebel.jar to generate the jrebel-bootstrap.jar using the JVM you will run the application with.

Add the following line to the MAVEN_OPTS environment variable:

-noverify -Xbootclasspath/p:%REBEL_HOME%\jrebel-bootstrap.jar;%REBEL_HOME%\jrebel.jar

To do it in the console:

  > java -jar %REBEL_HOME%\jrebel.jar
  > set MAVEN_OPTS=-noverify -Xbootclasspath/p:%REBEL_HOME%\jrebel-bootstrap.jar;%REBEL_HOME%\jrebel.jar %MAVEN_OPTS%
  > mvn jetty:run

4.7.8 Maven Jetty plugin (mvn jetty:run) on Linux/Mac OS X

Edit your pom.xml file and set the scanIntervalSeconds param to 0, this will turn off Jetty's internal reloading. It should look like this:
<plugin>
  <groupId>org.mortbay.jetty</groupId>
  <artifactId>jetty-maven-plugin</artifactId>
  <configuration>
    <scanIntervalSeconds>0</scanIntervalSeconds>
  </configuration>
</plugin>

Run java -jar $REBEL_HOME/jrebel.jar to generate the jrebel-bootstrap.jar using the JVM you will run the application with.

Add the following line to the MAVEN_OPTS environment variable:

-noverify -Xbootclasspath/p:$REBEL_HOME/jrebel-bootstrap.jar:$REBEL_HOME/jrebel.jar

To do it in the console:

  > java -jar $REBEL_HOME/jrebel.jar
  > export MAVEN_OPTS="-noverify -Xbootclasspath/p:$REBEL_HOME/jrebel-bootstrap.jar:$REBEL_HOME/jrebel.jar $MAVEN_OPTS"
  > mvn jetty:run
  

4.7.9 Oracle Application Server 10.x on Windows

Go to %ORACLE10_HOME%\bin and create the file oc4j-jrebel.cmd with the following contents:


set JREBEL_BOOTSTRAP="%~dp0\jrebel-bootstrap.jar"
java -Drebel.bootstrap=%JREBEL_BOOTSTRAP% -jar %REBEL_HOME%\jrebel.jar  
set OC4J_JVM_ARGS=-noverify -Xbootclasspath/p:%JREBEL_BOOTSTRAP%;%REBEL_HOME%\jrebel.jar %OC4J_JVM_ARGS%
call "%~dp0\oc4j.cmd" %*

Use this command file instead of oc4j.cmd if you want to run OC4J with JRebel.

4.7.10 Oracle Application Server 10.x on Linux/Mac OS X

Go to $ORACLE10_HOME/bin and create the file oc4j-jrebel.sh with the following contents:


#!/bin/bash
JREBEL_BOOTSTRAP=`dirname $0`/jrebel-bootstrap.jar
java -Drebel.bootstrap=$JREBEL_BOOTSTRAP -jar $REBEL_HOME/jrebel.jar
export OC4J_JVM_ARGS="-noverify -Xbootclasspath/p:$JREBEL_BOOTSTRAP:$REBEL_HOME/jrebel.jar $OC4J_JVM_ARGS"
`dirname $0`/oc4j $@

Make it executable and use this script instead of oc4j.sh if you want to run OC4J with JRebel.

4.7.11 Oracle Application Server 9.x on Windows

Run java -jar %REBEL_HOME%\jrebel.jar to generate the jrebel-bootstrap.jar using the JVM you will run the application with.

Go to folder %ORACLE9_HOME%\j2ee\home and start the server with the following command:

java -noverify -Xbootclasspath/p:%REBEL_HOME%\jrebel-bootstrap.jar;%REBEL_HOME%\jrebel.jar -jar oc4j.jar

4.7.12 Oracle Application Server 9.x on Linux/Mac OS X

Run java -jar $REBEL_HOME/jrebel.jar to generate the jrebel-bootstrap.jar using the JVM you will run the application with.

Go to folder $ORACLE9_HOME/j2ee/home and start the server with the following command:

java -noverify -Xbootclasspath/p:$REBEL_HOME/jrebel-bootstrap.jar:$REBEL_HOME/jrebel.jar -jar oc4j.jar

4.7.13 Caucho Resin 3.0.x on Windows

Run java -jar %REBEL_HOME%\jrebel.jar to generate the jrebel-bootstrap.jar using the JVM you will run the application with.

Start httpd.exe with parameters

httpd.exe -J-noverify -J-Xbootclasspath/p:%REBEL_HOME%\jrebel-bootstrap.jar;%REBEL_HOME%\jrebel.jar

4.7.14 Caucho Resin 3.0.x on Linux/Mac OS X

Run java -jar $REBEL_HOME/jrebel.jar to generate the jrebel-bootstrap.jar using the JVM you will run the application with.

Modify RESIN_HOME/bin/wrapper.pl $JAVA_ARGS variable to include the line:

-noverify -Xbootclasspath/p:$REBEL_HOME/jrebel-bootstrap.jar:$REBEL_HOME/jrebel.jar

4.7.15 SAP NetWeaver 7.0.x on Windows

Run java -jar %REBEL_HOME%\jrebel.jar to generate the jrebel-bootstrap.jar using the JVM you will run the application with.

Use Configuration management console to add the following parameters to the JVM:

-noverify -Xbootclasspath/p:%REBEL_HOME%\jrebel-bootstrap.jar:%REBEL_HOME%\jrebel.jar

4.7.16 SAP NetWeaver 7.0.x on Linux/Mac OS X

Run java -jar $REBEL_HOME/jrebel.jar to generate the jrebel-bootstrap.jar using the JVM you will run the application with.

Use Configuration management console to add the following parameters to the JVM:

-noverify -Xbootclasspath/p:$REBEL_HOME/jrebel-bootstrap.jar:$REBEL_HOME/jrebel.jar

4.7.17 Tomcat 4.x, 5.0.x on Windows

Go to %TOMCAT_HOME%\bin and create the file startup-jrebel.cmd with the following contents:


@echo off
set JREBEL_BOOTSTRAP="%~dp0\jrebel-bootstrap.jar"
java -Drebel.bootstrap=%JREBEL_BOOTSTRAP% -jar %REBEL_HOME%\jrebel.jar  
set JAVA_OPTS=-noverify -Xbootclasspath/p:%JREBEL_BOOTSTRAP%;%REBEL_HOME%\jrebel.jar %JAVA_OPTS%
call "%~dp0\startup.bat" %*

You can also create a catalina-jrebel.cmd with the following content:


@echo off
set JREBEL_BOOTSTRAP="%~dp0\jrebel-bootstrap.jar"
java -Drebel.bootstrap=%JREBEL_BOOTSTRAP% -jar %REBEL_HOME%\jrebel.jar  
set JAVA_OPTS=-noverify -Xbootclasspath/p:%JREBEL_BOOTSTRAP%;%REBEL_HOME%\jrebel.jar %JAVA_OPTS%
call "%~dp0\catalina.bat" %*

Use those command files instead of startup.bat and catalina.bat if you want to run Tomcat with JRebel.

If you're running Tomcat as a Windows service then first generate the jrebel-bootstrap.jar by running java -jar %REBEL_HOME%\jrebel.jar using the JVM you will run the application with. Then open the tomcatXw.exe wrapper (or double click the Tomcat icon in the system tray) and insert the following line into the Java » Java Options textbox:

-noverify -Xbootclasspath/p:%REBEL_HOME%\jrebel-bootstrap.jar;%REBEL_HOME%\jrebel.jar

as shown on the following screenshot:

4.7.18 Tomcat 4.x, 5.0.x on Linux/Mac OS X

Go to $TOMCAT_HOME/bin and create the file startup-jrebel.sh with the following contents:


#!/bin/bash
JREBEL_BOOTSTRAP=`dirname $0`/jrebel-bootstrap.jar
java -Drebel.bootstrap=$JREBEL_BOOTSTRAP -jar $REBEL_HOME/jrebel.jar
export JAVA_OPTS="-noverify -Xbootclasspath/p:$JREBEL_BOOTSTRAP:$REBEL_HOME/jrebel.jar $JAVA_OPTS"
`dirname $0`/startup.sh $@

You can also create a catalina-jrebel.sh with the following content:


#!/bin/bash
JREBEL_BOOTSTRAP=`dirname $0`/jrebel-bootstrap.jar
java -Drebel.bootstrap=$JREBEL_BOOTSTRAP -jar $REBEL_HOME/jrebel.jar
export JAVA_OPTS="-noverify -Xbootclasspath/p:$JREBEL_BOOTSTRAP:$REBEL_HOME/jrebel.jar $JAVA_OPTS"
`dirname $0`/catalina.sh $@

Make them executable and use those scripts instead of startup.sh and catalina.sh if you want to run Tomcat with JRebel.

4.7.19 Oracle Weblogic 7.x, 8.x on Windows

Go to %DOMAIN_HOME% and create the file startWebLogic-jrebel.cmd with the following contents:


@echo off
call setEnv.cmd
set JREBEL_BOOTSTRAP="%~dp0\jrebel-bootstrap.jar"
java -Drebel.bootstrap=%JREBEL_BOOTSTRAP% -jar %REBEL_HOME%\jrebel.jar
set JAVA_OPTIONS=-noverify -Xbootclasspath/p:%JREBEL_BOOTSTRAP%;%REBEL_HOME%\jrebel.jar %JAVA_OPTIONS%
call "%~dp0\startWebLogic.cmd" %*

Use this command file instead of startWebLogic.cmd if you want to run Weblogic with JRebel.

4.7.20 Oracle Weblogic 7.x, 8.x on Linux/Mac OS X

Go to $DOMAIN_HOME and create the file startWebLogic-jrebel.sh with the following contents:


#!/bin/bash
`dirname $0`/setEnv.sh
JREBEL_BOOTSTRAP=`dirname $0`/jrebel-bootstrap.jar
java -Drebel.bootstrap=$JREBEL_BOOTSTRAP -jar $REBEL_HOME/jrebel.jar
export JAVA_OPTIONS="-noverify -Xbootclasspath/p:$JREBEL_BOOTSTRAP:$REBEL_HOME/jrebel.jar $JAVA_OPTIONS"
`dirname $0`/startWebLogic.sh $@

Use this script instead of startWebLogic.sh if you want to run Weblogic with JRebel.

4.8 IBM JVM

4.8.1 IBM WebSphere 6.0.x, 6.1.x, 7.x on Windows

Make sure that JRebel installation folder doesn't contain spaces.

Generate the jrebel-bootstrap.jar by running java -jar %REBEL_HOME%\jrebel.jar using the JVM you will run the application server with (you can also add this line to the startServer.sh after the environment is set).

Start the IBM WebSphere server and run the Administrative Console.

2009-07-03_132313

In the Administration Console open Servers » Application Servers and select the server your app is deployed to.

2009-07-03_132842

Select Java and Process Management» Process Definition.

2009-07-03_133200

Select Java Virtual Machine.

2009-07-03_133350

Insert the following line into Generic JVM arguments for Websphere 6.1 or later running on IBM JDK 5 or later:

-noverify -Xshareclasses:none -Xbootclasspath/p:%REBEL_HOME%\jrebel-bootstrap.jar;%REBEL_HOME%\jrebel.jar

Insert the following line into Generic JVM arguments for Websphere 6.0 or later running on IBM JDK 1.4:

-noverify -Xbootclasspath/p:%REBEL_HOME%\jrebel-bootstrap.jar;%REBEL_HOME%\jrebel.jar

2009-07-03_133601

Press OK, when asked, Save the master configuration and restart the server.

4.8.2 IBM WebSphere 6.0.x, 6.1.x, 7.x on Linux/Mac OS X

Generate the jrebel-bootstrap.jar by running java -jar $REBEL_HOME/jrebel.jar using the JVM you will run the application server with (you can also add this line to the startServer.sh after the environment is set).

Start the IBM WebSphere server and run the Administrative Console.

2009-07-03_132313

In the Administration Console open Servers » Application Servers and select the server your app is deployed to.

2009-07-03_132842

Select Java and Process Management» Process Definition.

2009-07-03_133200

Select Java Virtual Machine.

2009-07-03_133350

Insert the following line into Generic JVM arguments for Websphere 6.1 or later running on IBM JDK 5 or later:

-noverify -Xshareclasses:none -Xbootclasspath/p:$REBEL_HOME/jrebel-bootstrap.jar:$REBEL_HOME/jrebel.jar

Insert the following line into Generic JVM arguments for Websphere 6.0 or later running on IBM JDK 1.4:

-noverify -Xbootclasspath/p:$REBEL_HOME/jrebel-bootstrap.jar:$REBEL_HOME/jrebel.jar

2009-07-03_133601

Press OK, when asked, Save the master configuration and restart the server.

4.8.3 Other servers or applications using IBM JDK on Windows

Generate the jrebel-bootstrap.jar by running java -jar %REBEL_HOME%\jrebel.jar using the JVM you will run the application server with.

Start your application with the extra java options -noverify -Xshareclasses:none -Xbootclasspath/p:%REBEL_HOME%\jrebel-bootstrap.jar;%REBEL_HOME%\jrebel.jar

4.8.4 Other servers or applications using IBM JDK on Linux/Mac OS X

Generate the jrebel-bootstrap.jar by running java -jar $REBEL_HOME/jrebel.jar using the JVM you will run the application server with.

Start your application with the extra java options -noverify -Xshareclasses:none -Xbootclasspath/p:$REBEL_HOME/jrebel-bootstrap.jar:$REBEL_HOME/jrebel.jar

5. Agent Configuration

5.1 Generic
5.2 Plugins

5.1 Generic

A configuration GUI is available in the Configuration Wizard and as standalone Agent Configuration util that you can run using bin/agent-settings.cmd or bin/agent-settings.sh:

JRebel can also be configured manually using the property file in $REBEL_HOME/conf/jrebel.properties, which can be overridden by Java system properties. A description of available properties follows.

rebel.packages=PACKAGE1,PACKAGE2,...
This should be set to a comma-separated list of Java packages. JRebel will then only reload classes in those packages and their subpackages. This is mainly used to restrict reloading to only a limited subset of classes, e.g. to improve performance.
rebel.packages_include=PACKAGE1,PACKAGE2,...
This should be set to a comma-separated list of Java packages. JRebel will also reload classes in those packages and their subpackages. This is mainly used to enable JAR file reloading. JRebel will reload classes that are not in the exclude packages and are in an include package. By default all .class classes will be reloaded.
For example rebel.packages_include=com.mycompany.mypackage,com.thirdparty.theirpackage.
rebel.packages_exclude=PACKAGE1,PACKAGE2,...
This should be set to a comma-separated list of Java packages. JRebel will not reload classes in those packages and their subpackages. This is mainly used to exclude classes that produce errors with JRebel reloading. JRebel will reload classes that are not in the exclude packages and are in an include package. By default all .class classes will be reloaded.
rebel.load_embedded_plugins=[true|false]
Controls whether embedded plugins are loaded. Set this to "false" if you're having troubles with embedded plugins.
rebel.plugins=jar1,jar2,jar3,...
Set this to absolute path of the plugin jars to load and enable them. This property overrides the embedded plugins that come with JRebel.
rebel.reload_bundles=[true|false]
Controls whether resource bundle monitoring and reloading is allowed. Set this to false if resource bundle reloading is causing problems.
rebel.stats=[true|false]
Controls whether redeploy statistics gathering and display is allowed. Set this to false if you want to disable it (note that statistics is collected locally).
rebel.usage_reporting=[true|false]
Controls whether anonymous usage reporting is allowed. Set this to false if you don't want to report anonymous usage statistics to ZeroTurnaround.
rebel.log=true
Enables debug logging to the jrebel.log file. Use when you are having some problems with the JRebel and you need to get more context.
rebel.log.perf=true
Enables additional logging of the performance statistics to the jrebel.log file. Requires JDK1.5+.
rebel.log.dump_stack_traces=[number of seconds]
Makes a thread dump into jrebel.log. The value of this parameter is the minimal delay (in seconds) between the dumps. Requires JDK1.5+.
rebel.log.trace=true
Enables trace logging to the jrebel.log file. Generates a very detailed, but extremely big log.
rebel.log.stdout=false
Disables all JRebel output to standard output, e.g. the console.
rebel.log.file=FILENAME
Set to an absolute filename that JRebel should output log to. You can also add a wild card {time} into the file name which will be replaced at JRebel start time, when you need a different log file from each JRebel instance
For example rebel.log.file=C:\work\rebel{time}.log
rebel.temp.dir=DIRECTORY
Set to an absolute path to a directory where JRebel should create it's temp files instead putting them in jrebel-temp

5.2 Plugins

Although class reloading is extremely sexy and gives you a great productivity boost there is more that you can do. Reloading framework configuration or framework configured components means that you don’t have to redeploy when adding a new Spring bean or configuring a new Tapestry listener.

Official plugins are included in the JRebel JAR file (if not stated otherwise). You will need to enable them depending on which framework you are using. JRebel will print out the list of found plugins on application startup and instructions on how to enable those specific plugins. You can enable the plugins using a system property, in Configuration Wizard or in Agent Configuration:


JRebel Reference Manual, ©ZeroTurnaround OÜ, Estonia, Tartu