©ZeroTurnaround OÜ, Estonia, Tartu
At JRebel download page, you are provided with several options for installation package download. You can choose between Windows-specific installation package, or two platform-independent packages. Note that two latter cases are suitable for installation on Windows PC.
If you select the Windows Installer option for download, you will be provided the installation package for Windows PC. Execute the binary after downloading it, and proceed with the setup as the installation wizard guides you through the process.
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
At the very final screen of the installation wizard you will have an option to start the configuration wizard which will provide the information about the IDE, application server and application setup with JRebel.
After the installation is complete, if you have selected to create the shortcuts in Start menu, a program group for JRebel will be created as follows:
For platforms other that Windows (but also Windows itself) we have provided the platform-neutral installation packages. There are two options provided for the download, either JAR installer, of a ZIP archive.
If you select the JAR Installer option for download, you will be provided a ZIP Archive, containing
a single jrebel-setup.jar
file. To execute the installation process proceed as follows:
> unzip jrebel-3.1.2a-setup.zip > cd jrebel > java -jar jrebel-setup.jar
The last command in the snippet above will execute the graphical wizard window which is exactly the same application as in case of Windows platform setup. Proceed with the installation steps by pushing Next button.
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.
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.
If you have installed JRebel using the installation wizard, either via Windows installation package or JAR installer,
then JRebel installation will include %JREBEL_HOME%\bin\uninstaller.jar
file. It can be used to
uninstall JRebel from your computer by executing it as follows:
java -jar uninstaller.jar
The following dialog will appear:
Check the checkbox in order to forcefully delete the JRebel's installation directory and proceed by pushing Uninstall button.
In case if you installed JRebel using ZIP archive, uninstaller.jar utility is not provided, so you can just delete the directory where you have unpacked it.
JRebel IDE plugins are available for Eclipse, IntelliJ IDEA and NetBeans and provide the following features:
[Missing in NetBeans and IntelliJ IDEA before 8.x]
[Missing in NetBeans and IntelliJ IDEA before 8.x]
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
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
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.*.
For best experience, go to Project » Build Automatically and make sure it is checked.
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
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
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.*.
For best experience, go to Project » Build Automatically and make sure it is checked.
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.
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
).
There are also some tweaks to be done in the debugger settings:
Open the debugger properties File » Settings » Debugger » Stepping. Tick Skip synthetic methods checkbox.
Open the debugger properties File » Settings » Debugger » Data Views. Untick the Synthetic fields checkbox.
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.
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
).
There are also some tweaks to be done in the debugger settings:
Open the debugger properties File » Settings » Debugger » Stepping. Tick Skip synthetic methods checkbox.
Open the debugger properties File » Settings » Debugger » HotSwap. Ensure that Reload classes after compilation is set either to Always or Ask
Open the debugger properties File » Settings » Debugger » Data Views. Untick the Synthetic fields checkbox.
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.
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.
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.
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.
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:
<jar>
.
<dirset>
or <jarset>
that accepts Ant-style patterns to specify the specific directories.
<dir>
and
<jar>
entries.
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.
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.
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.
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.
To generate the rebel.xml file right click on your project and pick 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:
To generate the rebel.xml file right click on your project and pick 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:
To generate the rebel.xml file right click on your project and pick 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:
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 install
command will trigger JRebel plugin to generate rebel.xml.
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.
<?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>
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).
|
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>
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>
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>
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>
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>
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>
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>
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>
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.
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>
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.
Attribute | Description | Required |
name | Name that will be filtered, can contain wildcards. See example from include tag for more information. | Yes |
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>
-javaagent:%REBEL_HOME%\jrebel.jar
to the JVM command line.java -jar %REBEL_HOME%\jrebel.jar
and then add the following to the command line:
-Xbootclasspath/p:%REBEL_HOME%\jrebel-bootstrap.jar;%REBEL_HOME%\jrebel.jar
WEB-INF/classes
or system classpath and changes will be picked up immediately on save. rebel.xml
configuration file. 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.
If you run a standalone application you can enable JRebel for its launch configuration.
To start the server with JRebel enabled, check the corresponding checkbox (Enable JRebel agent) in JRebel settings section.
If you run a standalone application you can enable JRebel for its launch configuration.
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.
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.
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.
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
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
File: %GAE_HOME%\bin\dev_appserver.cmd
Add the following line after com.google.appengine.tools.KickStart
:
--jvm_flag=-javaagent:%REBEL_HOME%\jrebel.jar ^
File: $GAE_HOME/bin/dev_appserver.sh
Add the following line after com.google.appengine.tools.KickStart
:
--jvm_flag=-javaagent:$REBEL_HOME/jrebel.jar \
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.
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.
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.jarPress Save and restart the server.
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.
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.
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.
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.
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.
Since Jetty does not have any startup scripts for Windows just add the following line to the command line:
-javaagent:%REBEL_HOME%\jrebel.jar
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.
Since Jetty does not have any startup scripts for Windows just add the following line to the command line:
-javaagent:%REBEL_HOME%\jrebel.jar
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.
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
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
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.
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.
Go to folder %ORACLE9_HOME%\j2ee\home
and start the
server with the following command:
java -javaagent:%REBEL_HOME%\jrebel.jar -jar oc4j.jar
Go to folder $ORACLE9_HOME/j2ee/home
and start the
server with the following command:
java -javaagent:$REBEL_HOME/jrebel.jar -jar oc4j.jar
To start Resin server with JRebel from %RESIN_HOME% use the following command line:
java -javaagent:%REBEL_HOME%\jrebel.jar -jar lib\resin.jar
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 $*
Start httpd.exe with parameters
httpd.exe -J-javaagent:%REBEL_HOME%\jrebel.jar
Modify $RESIN_HOME/bin/wrapper.pl $JAVA_ARGS variable to include the line:
-javaagent:$REBEL_HOME/jrebel.jar
Use Configuration management console to add the following parameters to the JVM:
-javaagent:%REBEL_HOME%\jrebel.jar
Use Configuration management console to add the following parameters to the JVM:
-javaagent:$REBEL_HOME/jrebel.jar
File: %PLATFORM_HOME%\bin\startup.bat
Add the following line:
set JAVA_OPTS=-javaagent:%REBEL_HOME%\jrebel.jar %JAVA_OPTS%
File: $PLATFORM_HOME/bin/startup.sh
Add the following line:
JAVA_OPTS="-javaagent:$REBEL_HOME/jrebel.jar $JAVA_OPTS"
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.
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.
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:
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.
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:
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.
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.
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.
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.
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.
Go to %JRUN_HOME%\bin and modify jvm.config configuration file. Append the following line to the
java.args
configuration parameter:
-javaagent:%REBEL_HOME%\jrebel.jar
Now you're ready to run JRebel enabled JRun server.
Go to $JRUN_HOME/bin and modify jvm.config configuration file. Append the following line to the
java.args
configuration parameter:
-javaagent:$REBEL_HOME/jrebel.jar
Now you're ready to run JRebel enabled JRun server.
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.
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.
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
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
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.
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.
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
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
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
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
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.
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.
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
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
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
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
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
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
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:
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.
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.
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.
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.
In the Administration Console open Servers » Application Servers and select the server your app is deployed to.
Select Java and Process Management» Process Definition.
Select Java Virtual Machine.
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
Press OK, when asked, Save the master configuration and restart the server.
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.
In the Administration Console open Servers » Application Servers and select the server your app is deployed to.
Select Java and Process Management» Process Definition.
Select Java Virtual Machine.
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
Press OK, when asked, Save the master configuration and restart the server.
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
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
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_include=com.mycompany.mypackage,com.thirdparty.theirpackage
.
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