## Installation

On Java 5 or later just add the following to JVM command line (note that it is important that the JAR would be named "javarebel.jar")

    -noverify -javaagent:/path/to/javarebel.jar

On Java 1.4 first run the following:

    java -jar /path/to/javarebel.jar

This will generate an `javarebel-bootstrap.jar` in the same directory as `javarebel.jar` and then add the following to JVM command line

    -noverify -Xbootclasspath/p:/path/to/javarebel-bootstrap.jar;/path/to/javarebel.jar

NB! The `javarebel-bootstrap.jar` is specific to the JVM version and JavaRebel version so be sure to regenerate every time the JVM or JavaRebel version changes! Also make sure that the JVM version you generate with is the same your application will run with! We suggest to add bootstrap generation command to the application/server startup script if possible.

With any Java version if you use an IDE that compiles classes on-the-fly set `-Drebel.dirs` property to point to the output folder, for example:

    -Drebel.dirs=/home/user/workspace/project/bin

Start the server or application as usual. If JavaRebel integration was successful you should see a message like this:

    ##########################################################
    # ZeroTurnaround JavaRebel x.y.z                         #
    # ...                                                    #
    ##########################################################

See Features for supported JVM and server versions.

### Configuration

The following classes will be reloaded

1. All ".class" classes inside the usual classpath (`WEB-INF/classes`, etc). Using this with exploded deployment will provide the best JavaRebel experience.
2. All ".class" classes in directories specified "-Drebel.dirs" comma-separated list JVM command line property. With this you can deploy in unexploded development mode (EAR or WAR) and still reload classes instantly. For example `-Drebel.dirs=/path/to/eclipse/project-one/bin,/path/to/eclipse/project-two/bin`. However new classes (or renamed old classes) will not be loaded before they also appear in the classpath (e.g. after the build in JAR files).

If you are using IDEA you should install this plugin to enable debugging with JavaRebel. You might also want to configure your IDE for better debugging experience.

If you have any problems with dynamic proxies (JDK, CgLib, Javassist) add "-Drebel.forbid_bypass=true" to the JVM command line to improve compatibility.

### Platform-specific

Further you can find specific instructions for different operating systems, application servers and so on.

Choose platform

### Standalone Applications

Just run as usual adding the integration string:

    java -noverify -javaagent:javarebel.jar MAIN_CLASS ARGS

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

### Standalone Applications

Just run as usual adding the integration string:

    java -noverify -javaagent:javarebel.jar MAIN_CLASS ARGS

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

### BEA Weblogic 9.x, 10.x

#### Windows

File: `%DOMAIN_HOME%\bin\startWeblogic.cmd`.
Add the following line:

    set JAVA_OPTIONS=-noverify -javaagent:javarebel.jar %JAVA_OPTIONS%

#### Linux

File: `$DOMAIN_HOME\bin\startWeblogic.sh`.
Add the following line:

    JAVA_OPTIONS=-noverify -javaagent:javarebel.jar $JAVA_OPTIONS

### Oracle Application Server 10.x

#### Windows

File: `%ORACLE10_HOME%\bin\oc4j.cmd`

Add the following line:

    set JVMARGS=-noverify -javaagent:javarebel.jar %JVMARGS%

#### Linux

File: `$ORACLE10_HOME/bin/oc4j`

Add the following line:

    JVMARGS="-noverify -javaagent:javarebel.jar $JVMARGS"

### Oracle Application Server 9.x (on Java 5)

#### Windows

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

    java -noverify -javaagent:javarebel.jar -jar oc4j.jar

#### Linux

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

    java -noverify -javaagent:javarebel.jar -jar oc4j.jar

### JBoss

#### Windows

File: `%JBOSS_HOME%\bin\run.bat`

Add the following line:

    set JAVA_OPTS=-noverify -javaagent:javarebel.jar %JAVA_OPTS%

#### Linux

File: `$JBOSS_HOME/bin/run.sh`

Add the following line:

    JAVA_OPTS="-noverify -javaagent:javarebel.jar $JAVA_OPTS"

### GlassFish V2

#### Windows & Linux

File: `%DOMAIN_HOME%\config\domain.xml`

Search for `jvm-options` element and add the elements `-noverify` and `-javaagent:javarebel.jar` Start the domain as usual.

### Maven/Jetty

You can also use JavaRebel with Maven Jetty plugin. Edit your `pom.xml` file and set the `scanIntervalSeconds` param to 0, this will turn off Jetty's internal reloading. Jetty's internal reloading won't keep your session after reloading changed classes. Start jetty with the maven jetty plugin and the `MAVEN_OPTS` parameter set

    MAVEN_OPTS="-noverify -javaagent:javarebel.jar" mvn jetty:run

Run `mvn compile` in another terminal and JavaRebel will reload your changed classes.

### Tomcat

#### Windows

File: `%TOMCAT_HOME%\bin\catalina.cmd`

Add the following line:

    set JAVA_OPTS=-noverify -javaagent:javarebel.jar %JAVA_OPTS%

If you use the windows service or system tray startup use the following parameters instead:

    -Xverify:none -javaagent:javarebel.jar

#### Linux

File: `$TOMCAT_HOME/bin/catalina.sh`

Add the following line:

     JAVA_OPTS="-noverify -javaagent:javarebel.jar $JAVA_OPTS"

### Jetty 5, 6

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

     -noverify -javaagent:javarebel.jar

### Caucho Resin 3.0.x

Copy javarebel.jar to RESIN_HOME/ folder.

#### Windows

Start httpd.exe with parameters

    httpd.exe -J-javaagent:javarebel.jar -J-noverify

#### Linux

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

    -javaagent:javarebel.jar -noverify

### Other

If JavaRebel doesn't work with your application or container it is most probably due to some custom classloaders that don't behave exactly 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 JavaRebel agent like this:

`-noverify -javaagent:javarebel.jar=com.acme.CustomClassLoader`

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

`-noverify -javaagent:javarebel.jar=com.acme.CustomClassLoader1,com.acme.CustomClassLoader2,...`

This should get most of the custom classloaders to work.

### Standalone Applications

To generate the `javarebel-bootstrap.jar` just run `java -jar javarebel.jar` using the JVM you will run the application with.

Just run as usual adding the integration string:

    java -noverify -Xbootclasspath/p:javarebel-bootstrap.jar;javarebel.jar MAIN_CLASS ARGS

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

### BEA Weblogic 7.x, 8.x

To generate the `javarebel-bootstrap.jar` just run `java -jar javarebel.jar` using the JVM you will run the application with.

#### Windows

File: `%DOMAIN_HOME%\bin\startWeblogic.cmd`.
Add the following line:

    set JAVA_OPTIONS=-noverify -Xbootclasspath/p:javarebel-bootstrap.jar;javarebel.jar %JAVA_OPTIONS%

#### Linux

File: `$DOMAIN_HOME\bin\startWeblogic.sh`.
Add the following line:

    JAVA_OPTIONS=-noverify -Xbootclasspath/p:javarebel-bootstrap.jar:javarebel.jar $JAVA_OPTIONS

### Oracle Application Server 10.x+

To generate the `javarebel-bootstrap.jar` just run `java -jar javarebel.jar` using the JVM you will run the application with.

#### Windows

File: `%ORACLE10_HOME%\bin\oc4j.cmd`

Add the following line:

    set JVMARGS=-noverify -Xbootclasspath/p:javarebel-bootstrap.jar;javarebel.jar %JVMARGS%

#### Linux

File: `$ORACLE10_HOME/bin/oc4j`

Add the following line:

    JVMARGS="-noverify -Xbootclasspath/p:javarebel-bootstrap.jar:javarebel.jar $JVMARGS"

### Oracle Application Server 9.x

To generate the `javarebel-bootstrap.jar` just run `java -jar javarebel.jar` using the JVM you will run the application with.

#### Windows

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

    java -noverify -Xbootclasspath/p:javarebel-bootstrap.jar;javarebel.jar -jar oc4j.jar

#### Linux

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

    java -noverify -Xbootclasspath/p:javarebel-bootstrap.jar:javarebel.jar -jar oc4j.jar

### JBoss

To generate the `javarebel-bootstrap.jar` just run `java -jar javarebel.jar` using the JVM you will run the application with.

#### Windows

File: `%JBOSS_HOME%\bin\run.bat`

Add the following line:

    set JAVA_OPTS=-noverify -Xbootclasspath/p:javarebel-bootstrap.jar;javarebel.jar %JAVA_OPTS%

#### Linux

File: `$JBOSS_HOME/bin/run.sh`

Add the following line:

    JAVA_OPTS="-noverify -Xbootclasspath/p:javarebel-bootstrap.jar:javarebel.jar $JAVA_OPTS"

### Maven/Jetty

To generate the `javarebel-bootstrap.jar` just run `java -jar javarebel.jar` using the JVM you will run the application with.

Edit your `pom.xml` file and set the `scanIntervalSeconds` param to 0, this will turn off Jetty's internal reloading. Jetty's internal reloading won't keep your session after reloading changed classes. Start jetty with the maven jetty plugin and the `MAVEN_OPTS` parameter set

    MAVEN_OPTS="-noverify -Xbootclasspath/p:javarebel-bootstrap.jar:javarebel.jar" mvn jetty:run

Run `mvn compile` in another terminal and JavaRebel will reload your changed classes.

### Tomcat

To generate the `javarebel-bootstrap.jar` just run `java -jar javarebel.jar` using the JVM you will run the application with.

#### Windows

File: `%TOMCAT_HOME%\bin\catalina.cmd`

Add the following line:

    set JAVA_OPTS=-noverify -Xbootclasspath/p:javarebel-bootstrap.jar;javarebel.jar %JAVA_OPTS%

If you use the windows service or system tray startup use the following parameters instead:

    -Xverify:none -Xbootclasspath/p:javarebel-bootstrap.jar;javarebel.jar

#### Linux

File: `$TOMCAT_HOME/bin/catalina.sh`

Add the following line:

     JAVA_OPTS="-noverify -Xbootclasspath/p:javarebel-bootstrap.jar:javarebel.jar $JAVA_OPTS"

### Jetty 5, 6

To generate the `javarebel-bootstrap.jar` just run `java -jar javarebel.jar` using the JVM you will run the application with.

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

    -noverify -Xbootclasspath/p:javarebel-bootstrap.jar;javarebel.jar

On Linux it changes to:

    -noverify -Xbootclasspath/p:javarebel-bootstrap.jar:javarebel.jar

### Caucho Resin 3.0.x

Copy javarebel.jar to RESIN_HOME/ folder.

#### Windows

Start httpd.exe with parameters

    httpd.exe -J-noverify -J-Xbootclasspath/p:javarebel-bootstrap.jar;javarebel.jar

#### Linux

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

    -noverify -Xbootclasspath/p:javarebel-bootstrap.jar:javarebel.jar

### Standalone Applications

Java 1.4 legacy installation mode supports JavaRebel in reduced functionality mode only. For example added methods will not be visible via Reflection API. Please use new intallation mode where possible.

Use the following command line:

    java -noverify com.zeroturnaround.javarebel.RebelCLI MAIN_CLASS ARGS

### BEA WebLogic 8.x

Java 1.4 legacy installation mode supports JavaRebel in reduced functionality mode only. For example added methods will not be visible via Reflection API. Please use new intallation mode where possible.

Download `javarebel-x.y.z.jar`. Put it in the domain directory (e.g. `user_projects/domains/mydomain`). Modify the `startWebLogic.cmd`. Prepend `javarebel-x.y.z.jar` to WebLogic classpath (you can rename it to `javarebel.jar` to make upgrading easier):

    set CLASSPATH=javarebel-x.y.z.jar;%CLASSPATH%

Note that it is important for `javarebel-x.y.z.jar` to be the first entry in the classpath!

Add -noverify to `JAVA_OPTIONS`:

    set JAVA_OPTIONS=-noverify %JAVA_OPTIONS%

Add a following line before the server is called:

    %JAVA_HOME%\bin\java com.zeroturnaround.javarebel.weblogic.Install

Start the server as usual.

NB! Due to a bug in JRockit JVM you will need version 8.1sp6 or later for JavaRebel to function successfully! This problem does not affect other JVMs (e.g. Sun JVM)

### Oracle Container for Java EE 9.x

Java 1.4 legacy installation mode supports JavaRebel in reduced functionality mode only. For example added methods will not be visible via Reflection API. Please use new intallation mode where possible.

#### Windows & Linux

We assume that javarebel.jar is located under OC4J_HOME/j2ee/home and for starting OC4J without JavaRebel the standard java -jar oc4j.jaris used.

- Run `java -cp javarebel.jar com.zeroturnaround.javarebel.oc4j9.Install`
- Use `java -cp javarebel.jar:oc4j.jar com.evermind.server.OC4JServer` to start the container.

### Oracle Container for Java EE 10.x

Java 1.4 legacy installation mode supports JavaRebel in reduced functionality mode only. For example added methods will not be visible via Reflection API. Please use new intallation mode where possible.

#### Linux

We assume that javarebel.jar is located under OC4J_HOME/bin and for starting OC4J without JavaRebel the standard oc4j -start is used.

Search for the line that starts the server:

    $JAVA_HOME/bin/java $JVMARGS -jar $OC4J_JAR $CMDARGS

Replace this with

    $JAVA_HOME/bin/java -cp javarebel.jar com.zeroturnaround.javarebel.oc4j10.Install
    $JAVA_HOME/bin/java $JVMARGS -cp javarebel.jar:$OC4J_JAR oracle.oc4j.loader.boot.BootStrap $CMDARGS

This will start the container as usual but also includes the JavaRebel integration.

#### Windows

We assume that javarebel.jar is located under OC4J_HOME\bin and for starting OC4J without JavaRebel the standard oc4j.cmd -start is used.

Search for the line that starts the server:

    "%JAVA_HOME%\bin\java" %JVMARGS% -jar "%OC4J_JAR%" %CMDARGS%

Replace this with

    "%JAVA_HOME%\bin\java" -cp javarebel.jar com.zeroturnaround.javarebel.oc4j10.Install
    "%JAVA_HOME%\bin\java" %JVMARGS% -cp "javarebel.jar:%OC4J_JAR%" oracle.oc4j.loader.boot.BootStrap %CMDARGS%

This will start the container as usual but also includes the JavaRebel integration.

### Tomcat 4

Java 1.4 legacy installation mode supports JavaRebel in reduced functionality mode only. For example added methods will not be visible via Reflection API. Please use new intallation mode where possible.

This configuration assumes that javarebel.jar is located under CATALINA_HOME/bin directory.

#### Windows

File: `%TOMCAT_HOME%\bin\catalina.cmd`

Add the following line just before "rem Execute Java with the applicable properties":

    set JAVA_OPTS=-noverify %JAVA_OPTS%
    set CLASSPATH=javarebel.jar;%CLASSPATH%
    "%JAVA_HOME%\bin\java.exe" -cp "%CLASSPATH%;..\server\lib\catalina.jar" \
    com.zeroturnaround.javarebel.tomcat.Install

#### Linux

File: `$TOMCAT_HOME/bin/catalina.sh`

Add the following line just after elif [ $1? = "start" ] ; then:

    JAVA_OPTS="-noverify $JAVA_OPTS"
    CLASSPATH="javarebel.jar:$CLASSPATH"
    "$_RUNJAVA" $JAVA_OPTS -classpath "../server/lib/catalina.jar:$CLASSPATH" \
    com.zeroturnaround.javarebel.tomcat.Install