Legacy Agent (Java 1.4)

Warning

Java 1.4 support in the Legacy Agent has been deprecated as of JRebel 7.1.0.

This document details configuring servers to work with JRebel using Java 1.5 (HotSpot and JRockit). Looking for other configuration instructions? You can find them here:

Tip

Using a JRebel IDE plugin? You have access to all these snippets via Help > JRebel > Configuration > Startup.


JBoss 4.x

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

Windows

  1. Open %JBOSS_HOME%\bin.
  2. 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 jrebel.jar
set JAVA_OPTS=-noverify -Xbootclasspath/p:%JREBEL_BOOTSTRAP%;jrebel.jar %JAVA_OPTS%
call "%~dp0\run.bat" %*
  1. Use this file instead of run.bat to run JBoss with JRebel.

Linux and Mac OS

  1. Open $JBOSS_HOME/bin.
  2. 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 jrebel.jar
export JAVA_OPTS="-noverify -Xbootclasspath/p:$JREBEL_BOOTSTRAP:jrebel.jar $JAVA_OPTS"
`dirname $0`/run.sh $@
  1. Use this script instead of run.sh to run JBoss with JRebel.

Jetty 5.x and 6.x

Windows

  1. Run java -jar jrebel.jar to generate jrebel-bootstrap.jar using the JVM you will run the application with.
  2. Add the following line to the JVM command line:
-noverify -Xbootclasspath/p:jrebel-bootstrap.jar;jrebel.jar

Linux and Mac OS

  1. Run java -jar jrebel.jar to generate jrebel-bootstrap.jar using the JVM you will run the application with.
  2. Add the following line to the JVM command line:
-noverify -Xbootclasspath/p:jrebel-bootstrap.jar;jrebel.jar

Maven Jetty plugin (mvn jetty:run)

Windows

  1. Edit your pom.xml file.
  2. Set the scanIntervalSeconds parametere to 0. This will turn off Jetty’s internal reloading. It should look like this:
<plugin>
  <groupId>org.eclipse.jetty</groupId>
  <artifactId>jetty-maven-plugin</artifactId>
  <configuration>
    <scanIntervalSeconds>0</scanIntervalSeconds>
  </configuration>
</plugin>
  1. Run java -jar [c:\path\to\]jrebel.jar to generate jrebel-bootstrap.jar using the JVM you will run the application with.
  2. Add the following line to the MAVEN_OPTS environment variable:
-noverify -Xbootclasspath/p:[c:\path\to\]jrebel-bootstrap.jar;[c:\path\to\]jrebel.jar

To do this in the console:

java -jar [c:\path\to\]jrebel.jar
set MAVEN_OPTS=-noverify -Xbootclasspath/p:[c:\path\to\]jrebel-bootstrap.jar;[c:\path\to\]jrebel.jar %MAVEN_OPTS%
mvn jetty:run

Linux and Mac OS

  1. Edit your pom.xml file.
  2. Set the scanIntervalSeconds parameter to 0. This will turn off Jetty’s internal reloading. It should look like this:
<plugin>
  <groupId>org.eclipse.jetty</groupId>
  <artifactId>jetty-maven-plugin</artifactId>
  <configuration>
    <scanIntervalSeconds>0</scanIntervalSeconds>
  </configuration>
</plugin>
  1. Run java -jar [/path/to/]jrebel.jar to generate jrebel-bootstrap.jar using the JVM you will run the application with.
  2. Add the following line to the MAVEN_OPTS environment variable:
-noverify -Xbootclasspath/p:[/path/to/]jrebel-bootstrap.jar:[/path/to/]jrebel.jar

To do this in the console:

java -jar [/path/to/]jrebel.jar
export MAVEN_OPTS="-noverify -Xbootclasspath/p:[/path/to/]jrebel-bootstrap.jar:[/path/to/]jrebel.jar $MAVEN_OPTS"
mvn jetty:run

OC4J (Oracle Application Server) 9.x

Windows

  1. Run java -jar [c:\path\to\]jrebel.jar to generate jrebel-bootstrap.jar using the JVM you will run the application with.
  2. Open %ORACLE9_HOME%\j2ee\home
  3. Start the server with the following command:
java -noverify -Xbootclasspath/p:[c:\path\to\]jrebel-bootstrap.jar;[c:\path\to\]jrebel.jar -jar oc4j.jar

Linux and Mac OS

  1. Run java -jar [/path/to/]jrebel.jar to generate jrebel-bootstrap.jar using the JVM you will run the application with.
  2. Open $ORACLE9_HOME/j2ee/home.
  3. Start the server with the following command:
java -noverify -Xbootclasspath/p:[/path/to/]jrebel-bootstrap.jar:[/path/to/]jrebel.jar -jar oc4j.jar

OC4J (Oracle Application Server) 10.x

Windows

  1. Open %ORACLE10_HOME%\bin.
  2. Create the file oc4j-jrebel.cmd with the following content:
set JREBEL_BOOTSTRAP="%~dp0\jrebel-bootstrap.jar"
java -Drebel.bootstrap=%JREBEL_BOOTSTRAP% -jar [c:\path\to\]jrebel.jar
set OC4J_JVM_ARGS=-noverify -Xbootclasspath/p:%JREBEL_BOOTSTRAP%;[c:\path\to\]jrebel.jar %OC4J_JVM_ARGS%
call "%~dp0\oc4j.cmd" %*
  1. Use this file instead of oc4j.cmd to run OC4J with JRebel.

Linux and Mac OS

  1. Open $ORACLE10_HOME/bin.
  2. Create the file oc4j-jrebel.sh with the following content:
#!/bin/bash
JREBEL_BOOTSTRAP=`dirname $0`/jrebel-bootstrap.jar
java -Drebel.bootstrap=$JREBEL_BOOTSTRAP -jar jrebel.jar
export OC4J_JVM_ARGS="-noverify -Xbootclasspath/p:$JREBEL_BOOTSTRAP:jrebel.jar $OC4J_JVM_ARGS"
`dirname $0`/oc4j $@
  1. Make this file executable. Use this script instead of oc4j.sh to run OC4J with JRebel.

Resin 3.0.x

Windows

  1. Run java -jar [c:\path\to\]jrebel.jar to generate jrebel-bootstrap.jar using the JVM you will run the application with.
  2. Start httpd.exe with the following parameters:
httpd.exe -J-noverify -J-Xbootclasspath/p:[c:\path\to\]jrebel-bootstrap.jar;[c:\path\to\]jrebel.jar

Linux and Mac OS

  1. Run java -jar [/path/to/]jrebel.jar to generate jrebel-bootstrap.jar using the JVM you will run the application with.
  2. Modify $RESIN_HOME/bin/wrapper.pl variable ${JAVA_ARGS} to include the line:
-noverify -Xbootclasspath/p:[/path/to/]jrebel-bootstrap.jar:[/path/to/]jrebel.jar

Tomcat 4.x and 5.0.x

Windows

  1. Open %TOMCAT_HOME%\bin.
  2. Create the file startup-jrebel.cmd with the following content:
@echo off
set JREBEL_BOOTSTRAP="%~dp0\jrebel-bootstrap.jar"
java -Drebel.bootstrap=%JREBEL_BOOTSTRAP% -jar [c:\path\to\]jrebel.jar
set JAVA_OPTS=-noverify -Xbootclasspath/p:%JREBEL_BOOTSTRAP%;[c:\path\to\]jrebel.jar %JAVA_OPTS%
call "%~dp0\startup.bat" %*
  1. Alternatively, create catalina-jrebel.cmd with the following content:
@echo off
set JREBEL_BOOTSTRAP="%~dp0\jrebel-bootstrap.jar"
java -Drebel.bootstrap=%JREBEL_BOOTSTRAP% -jar [c:\path\to\]jrebel.jar
set JAVA_OPTS=-noverify -Xbootclasspath/p:%JREBEL_BOOTSTRAP%;[c:\path\to\]jrebel.jar %JAVA_OPTS%
call "%~dp0\catalina.bat" %*
  1. Use these files instead of startup.bat and catalina.bat to run Tomcat with JRebel.

If you’re running Tomcat as a Windows service, first generate the jrebel-bootstrap.jar by running java -jar 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:

-noverify -Xbootclasspath/p:[c:\path\to\]jrebel-bootstrap.jar;[c:\path\to\]jrebel.jar

Linux and Mac OS

  1. Open $TOMCAT_HOME/bin.
  2. Create the file startup-jrebel.sh with the following content:
#!/bin/bash
JREBEL_BOOTSTRAP=`dirname $0`/jrebel-bootstrap.jar
java -Drebel.bootstrap=$JREBEL_BOOTSTRAP -jar [/path/to/]jrebel.jar
export JAVA_OPTS="-noverify -Xbootclasspath/p:$JREBEL_BOOTSTRAP:[/path/to/]jrebel.jar $JAVA_OPTS"
`dirname $0`/startup.sh $@
  1. Alternatively, create catalina-jrebel.sh with the following content:
#!/bin/bash
JREBEL_BOOTSTRAP=`dirname $0`/jrebel-bootstrap.jar
java -Drebel.bootstrap=$JREBEL_BOOTSTRAP -jar [/path/to/]jrebel.jar
export JAVA_OPTS="-noverify -Xbootclasspath/p:$JREBEL_BOOTSTRAP:[/path/to/]jrebel.jar $JAVA_OPTS"
`dirname $0`/catalina.sh $@
  1. Make these files executable and use the scripts instead of startup.sh and catalina.sh to run Tomcat with JRebel.

WebLogic 7.x and 8.x

Windows

  1. Open the relevant WebLogic domain directory.
  2. Create the file startWebLogic-jrebel.cmd with the following content:
@echo off
call setEnv.cmd
set JREBEL_BOOTSTRAP="%~dp0\jrebel-bootstrap.jar"
java -Drebel.bootstrap=%JREBEL_BOOTSTRAP% -jar [c:\path\to\]jrebel.jar
set JAVA_OPTIONS=-noverify -Xbootclasspath/p:%JREBEL_BOOTSTRAP%;[c:\path\to\]jrebel.jar %JAVA_OPTIONS%
call "%~dp0\startWebLogic.cmd" %*
  1. Use this file instead of startWebLogic.cmd to run WebLogic with JRebel.

Linux and Mac OS

  1. Open the relevant WebLogic domain directory.
  2. Create the file startWebLogic-jrebel.sh with the following content:
#!/bin/bash
`dirname $0`/setEnv.sh
JREBEL_BOOTSTRAP=`dirname $0`/jrebel-bootstrap.jar
java -Drebel.bootstrap=$JREBEL_BOOTSTRAP -jar [/path/to/]jrebel.jar
export JAVA_OPTIONS="-noverify -Xbootclasspath/p:$JREBEL_BOOTSTRAP:[/path/to/]jrebel.jar $JAVA_OPTIONS"
`dirname $0`/startWebLogic.sh $@
  1. Use this script instead of startWebLogic.sh to run WebLogic with JRebel.

WebSphere 6.x, 7.x and 8.x

Windows

Make sure that JRebel installation folder does not contain spaces.

  1. Generate jrebel-bootstrap.jar by running java -jar [c:\path\to\]jrebel.jar using the JVM you will run the application server with (you can also add this line to the startServer.sh once the environment is set).
  2. Start the IBM WebSphere server and open the administrative console:
../_images/websphere-1.png
  1. In the Admin Console open Servers > Application servers. Select the server your application is deployed to:
../_images/websphere-2.png
  1. Select Java and Process Management > Process Definition:
../_images/websphere-3.png
  1. Select Java Virtual Machine:
../_images/websphere-4.png
  1. Insert the following line into Generic JVM arguments for WebSphere 6.0 or later running on IBM JDK 1.4:
-noverify -Xbootclasspath/p:[c:\path\to\]jrebel-bootstrap.jar;[c:\path\to\]jrebel.jar
../_images/websphere-5.png
  1. Press OK. When asked, save the master configuration and restart the server.

Linux and Mac OS

  1. Generate the jrebel-bootstrap.jar by running java -jar [/path/to/]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).
  2. Start the IBM WebSphere server and open the administrative console:
../_images/websphere-1.png
  1. In the Administration Console open Servers > Application Servers. Select the server your application is deployed to:
../_images/websphere-2.png
  1. Select Java and Process Management > Process Definition:
../_images/websphere-3.png
  1. Select Java Virtual Machine:
../_images/websphere-4.png
  1. Insert the following line into Generic JVM arguments for WebSphere 6.0 or later running on IBM JDK 1.4:
-noverify -Xbootclasspath/p:[/path/to/]jrebel-bootstrap.jar:[/path/to/]jrebel.jar
../_images/websphere-5.png
  1. Press OK. When asked, save the master configuration and restart the server.