=32-bit JVM|64-bit JVM=

==GlassFish 4.x, 5.x and 6.x==

===Linux|macOS===
====Open the *GlassFish Administration Console.*====
====Access *Configuration > JVM Settings > JVM Options.*====
====Use the *Add JVM Option* button to insert the following:====
{{{
-agentpath:${{jrebel.home.jar}}${{jrebel.lib}}
}}}
====Press *Save*. Restart the server.====

===Windows===
====Open the *GlassFish Administration Console.*====
====Access *Configuration > JVM Settings > JVM Options.*====
====Use the *Add JVM Option* button to insert the following:====
{{{
-agentpath:${{jrebel.home.jar}}${{jrebel.lib}}
}}}
====Press *Save*. Restart the server.====


==GWT (Google Web Toolkit) 2.x==

===Linux|macOS===
====Open the GWT project directory.====
====Create the file run-jrebel.sh with the following content:====
{{{
#!/bin/bash
export REBEL_BASE="${{jrebel.base}}"
export REBEL_HOME="${{jrebel.home.jar}}"
export ANT_OPTS="\"-agentpath:$REBEL_HOME${{jrebel.lib}}\" $ANT_OPTS"
ant devmode
}}}
====Use run-jrebel.sh to run your GWT application in development mode with JRebel enabled.====

===Windows===
====Open the GWT project directory.====
====Create the file run-jrebel.cmd with the following content:====
{{{
@echo off
set REBEL_BASE=<${cmds{${{jrebel.base}}}}$>
set REBEL_HOME=<${cmds{${{jrebel.home.jar}}}}$>
set ANT_OPTS=-agentpath:<${cmds{%REBEL_HOME%${{jrebel.lib}}}}$>
ant devmode
}}}
====Use run-jrebel.cmd to run your GWT application in development mode with JRebel enabled.====


==Hybris==

===Linux|macOS===
====Open the *$PLATFORM_HOME/config/local.properties* file.====
====Add the following to use the JRebel Agent:====
{{{
tomcat.javaoptions=-agentpath:${{jrebel.home.jar}}${{jrebel.lib}}
}}}
====Run *ant all* command.====
====Use *./hybrisserver.sh run*.====
====Need to make changes to backoffice extensions or to enable JRebel for Hybris while debugging? Refer to this link: ====
{{{
https://manuals.jrebel.com/jrebel/advanced/hybris.html
}}}

===Windows===
====Open the *%PLATFORM_HOME%\config\local.properties* file.====
====Add the following to use the JRebel Agent:====
{{{
tomcat.javaoptions=-agentpath:${{jrebel.home.jar}}${{jrebel.lib}}
}}}
====Run *ant all* command.====
====Use *hybrisserver.bat run*.====
====Need to make changes to backoffice extensions or to enable JRebel for Hybris while debugging? Refer to this link: ====
{{{
https://manuals.jrebel.com/jrebel/advanced/hybris.html
}}}


==JBoss EAP==

===Linux|macOS===
====Open $JBOSS_HOME/bin.====
====Create the file standalone-jrebel.sh with the following content:====
{{{
#!/bin/bash
export REBEL_BASE="${{jrebel.base}}"
export REBEL_HOME="${{jrebel.home.jar}}"
export JAVA_OPTS="\"-agentpath:$REBEL_HOME${{jrebel.lib}}\" $JAVA_OPTS"
`dirname $0`/standalone.sh $@
}}}
====Use this script instead of standalone.sh to run JBoss with JRebel.====
*Warning:* Any further customization to JAVA_OPTS inside the JBoss executable (default standalone.conf.sh) needs to be included in standalone-jrebel.sh for JRebel to function correctly.

===Windows===
====Open %JBOSS_HOME%\bin.====
====Create the file standalone-jrebel.cmd with the following content:====
{{{
@echo off
set REBEL_BASE=<${cmds{${{jrebel.base}}}}$>
set REBEL_HOME=<${cmds{${{jrebel.home.jar}}}}$>
set JAVA_OPTS=-agentpath:<${cmds{%REBEL_HOME%${{jrebel.lib}}}}$> %JAVA_OPTS%
call "%~dp0\standalone.bat" %*
}}}
====Use this file instead of standalone.bat to run JBoss with JRebel.====
*Warning:* Any further customization to JAVA_OPTS inside the JBoss executable (default standalone.conf.bat) needs to be included in standalone-jrebel.cmd for JRebel to function correctly.

==Jetty 9.x, 10.x and 11.x==

===Linux|macOS===
====Open $JETTY_HOME/bin.====
====Create the file run-jrebel.sh with the following content:====
{{{
#!/bin/bash
export REBEL_BASE="${{jrebel.base}}"
export REBEL_HOME="${{jrebel.home.jar}}"
export JAVA_OPTIONS="\"-agentpath:$REBEL_HOME${{jrebel.lib}}\" $JAVA_OPTIONS"
`dirname $0`/jetty.sh $@
}}}
====Use this script instead of jetty.sh to run Jetty with JRebel.====

===Windows===
====Jetty does not have any startup scripts for Windows. Just add the following line to the command line:====
{{{
-agentpath:<${cmds{${{jrebel.home.jar}}${{jrebel.lib}}}}$>
}}}


==Maven Jetty plugin (mvn jetty:run)==

===Linux|macOS===
====Open your pom.xml file and 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>
}}}
====Add the following line to the MAVEN_OPTS environment variable:====
{{{
-agentpath:<${bashs{${{jrebel.home.jar}}${{jrebel.lib}}}}$>
}}}
====To do this in the console:====
{{{
export MAVEN_OPTS="-agentpath:<${bashs{${{jrebel.home.jar}}${{jrebel.lib}}}}$> $MAVEN_OPTS"
mvn jetty:run
}}}

===Windows===
====Open your pom.xml file and 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>
}}}
====Add the following line to the MAVEN_OPTS environment variable:====
{{{
-agentpath:<${cmds{${{jrebel.home.jar}}${{jrebel.lib}}}}$>
}}}
====To do this in the console:====
{{{
set MAVEN_OPTS=-agentpath:<${cmds{${{jrebel.home.jar}}${{jrebel.lib}}}}$> %MAVEN_OPTS%
mvn jetty:run
}}}


==Payara 4.1.x and 5.x==

===Linux|macOS===
====Open the *Payara Administration Console.*====
====Access *Configuration > JVM Settings > JVM Options.*====
====Use the *Add JVM Option* button to insert the following:====
{{{
-agentpath:${{jrebel.home.jar}}${{jrebel.lib}}
}}}
====Press *Save*. Restart the server.====

===Windows===
====Open the *Payara Administration Console.*====
====Access *Configuration > JVM Settings > JVM Options.*====
====Use the *Add JVM Option* button to insert the following:====
{{{
-agentpath:${{jrebel.home.jar}}${{jrebel.lib}}
}}}
====Press *Save*. Restart the server.====


==Resin 4.x==

===Linux|macOS===
====Replace the last line of ${RESIN_HOME}/bin/resin.sh with the following:====
{{{
java -agentpath:<${bashs{${{jrebel.home.jar}}${{jrebel.lib}}}}$> -jar ${RESIN_HOME}/lib/resin.jar $*
}}}

===Windows===
====Start Resin with JRebel from %RESIN_HOME% with the parameter:====
{{{
java -agentpath:<${cmds{${{jrebel.home.jar}}${{jrebel.lib}}}}$> -jar lib\resin.jar
}}}


==Spring Boot==

===Linux|macOS===
====Use one of the following instructions based on your Spring Boot startup method:====
When running your application using java -jar, add -agentpath as follows:
{{{
java -agentpath:<${bashs{${{jrebel.home.jar}}${{jrebel.lib}}}}$> -jar myapp-boot.jar
}}}
When running your application using the Maven Spring Boot plugin, add the spring-boot.run.jvmArguments property as follows:
{{{
mvn spring-boot:run -Dspring-boot.run.jvmArguments="-agentpath:<${squotes{${{jrebel.home.jar}}${{jrebel.lib}}}}$>"
}}}
When running your application using gradle bootRun, add to build.gradle:
{{{
if (project.hasProperty('rebelAgent')) {
    bootRun.jvmArgs += rebelAgent
}
}}}
Add to ~/.gradle/gradle.properties (create this file if it doesn't exist):
{{{
rebelAgent=-agentpath:<${bashs{${{jrebel.home.jar.escaped}}${{jrebel.lib.escaped}}}}$>
}}}

===Windows===
====Use one of the following instructions based on your Spring Boot startup method:====
When running your application using java -jar, add -agentpath as follows:
{{{
java -agentpath:<${cmds{${{jrebel.home.jar}}${{jrebel.lib}}}}$> -jar myapp-boot.jar
}}}
When running your application using the Maven Spring Boot plugin, add the spring-boot.run.jvmArguments property as follows:
{{{
mvn spring-boot:run -Dspring-boot.run.jvmArguments="-agentpath:<${cmds{${{jrebel.home.jar}}${{jrebel.lib}}}}$>"
}}}
When running your application using gradle bootRun, add to build.gradle:
{{{
if (project.hasProperty('rebelAgent')) {
    bootRun.jvmArgs += rebelAgent
}
}}}
Add to ~/.gradle/gradle.properties (create this file if it doesn't exist):
{{{
rebelAgent=-agentpath:<${cmds{${{jrebel.home.jar.escaped}}${{jrebel.lib.escaped}}}}$>
}}}


==Standalone application==

===Linux|macOS===
====Add JRebel arguments to the JVM command line:====
{{{
java -agentpath:<${bashs{${{jrebel.home.jar}}${{jrebel.lib}}}}$> foo.bar.MyApp
}}}

===Windows===
====Add JRebel arguments to the JVM command line:====
{{{
java -agentpath:<${cmds{${{jrebel.home.jar}}${{jrebel.lib}}}}$> foo.bar.MyApp
}}}

==tc Server 4.x==

===Linux|macOS===
====Create your server instance to a folder of your choice. For example $INSTANCE_DIR====
====Open script $INSTANCE_DIR/bin/setenv.sh.====
====Add the following as the last lines of setenv.sh:====
{{{
REBEL_BASE="${{jrebel.base}}"
REBEL_HOME="${{jrebel.home.jar}}"
JAVA_OPTS="\"-agentpath:$REBEL_HOME${{jrebel.lib}}\" $JAVA_OPTS"
}}}
====Use the $SPRING_TC_HOME/tcruntime-ctl.sh script to start Tomcat instances as usual.====

===Windows===
====Open %SPRING_TC_HOME%. Select the Tomcat instance (%CATALINA_BASE%) you would like to run.====
====Open %CATALINA_BASE%\conf\wrapper.conf.====
====In the Java Additional Parameters section, add the additional `wrapper.java.additional.*` properties:====
{{{
wrapper.java.additional.10=-agentpath:<${cmds{${{jrebel.home.jar}}${{jrebel.lib}}}}$>
}}}
====Use the %SPRING_TC_HOME%\tcruntime-ctl.bat script to start Tomcat instances as usual.====


==Tomcat 9.x and 10.x==

===Linux|macOS===
====Open $TOMCAT_HOME/bin.====
====Create the file catalina-jrebel.sh with the following content:====
{{{
#!/bin/bash
export REBEL_BASE="${{jrebel.base}}"
export REBEL_HOME="${{jrebel.home.jar}}"
export JAVA_OPTS="\"-agentpath:$REBEL_HOME${{jrebel.lib}}\" $JAVA_OPTS"
`dirname $0`/catalina.sh $@
}}}
====Use catalina-jrebel.sh to run Tomcat with JRebel.====
{{{
./catalina-jrebel.sh run
}}}

===Windows===
====Open %TOMCAT_HOME%\bin.====
====Create the file catalina-jrebel.bat with the following content:====
{{{
@echo off
set REBEL_BASE=<${cmds{${{jrebel.base}}}}$>
set REBEL_HOME=<${cmds{${{jrebel.home.jar}}}}$>
set JAVA_OPTS="-agentpath:<${cmds{%REBEL_HOME%${{jrebel.lib}}}}$>" %JAVA_OPTS%
call "%~dp0\catalina.bat" %*
}}}
====Use catalina-jrebel.bat to run Tomcat with JRebel.====
{{{
catalina-jrebel.bat run
}}}
When running Tomcat as a service, please open tomcatXw.exe wrapper (or double click the Tomcat icon in the system tray). Insert the following line in Java > Java Options:
{{{
-agentpath:<${cmds{${{jrebel.home.jar}}${{jrebel.lib}}}}$>
}}}


==WebLogic 12.x and 14.x==

===Linux|macOS===
====Open $DOMAIN_HOME/bin====
====Create the file startWeblogic-jrebel.sh with the following content:====
{{{
#!/bin/bash
export REBEL_BASE="${{jrebel.base}}"
export REBEL_HOME="${{jrebel.home.jar}}"
export JAVA_OPTIONS="\"-agentpath:$REBEL_HOME${{jrebel.lib}}\" $JAVA_OPTIONS"
`dirname $0`/startWebLogic.sh $@
}}}
====Use this script instead of startWeblogic.sh to run WebLogic with JRebel.====
*Warning:* It is highly recommended to avoid using class caching (CLASS_CACHE=true). In some cases this may prevent classes and resources from being reloaded.

===Windows===
====Open %DOMAIN_HOME%\bin====
====Create the file startWeblogic-jrebel.cmd with the following content:====
{{{
@echo off
set REBEL_BASE=<${cmds{${{jrebel.base}}}}$>
set REBEL_HOME=<${cmds{${{jrebel.home.jar}}}}$>
set JAVA_OPTIONS=-agentpath:<${cmds{%REBEL_HOME%${{jrebel.lib}}}}$> %JAVA_OPTIONS%
call "%~dp0\startWebLogic.cmd" %*
}}}
====Use this file instead of startWeblogic.cmd to run WebLogic with JRebel.====
*Warning:* It is highly recommended to avoid using class caching (CLASS_CACHE=true). In some cases this may prevent classes and resources from being reloaded.


==WebSphere 8.5.5 and 9.x==

===Linux|macOS===
====Start the IBM WebSphere server and open the administrative console.====
====In the Administration Console open Servers > Application Servers. Select the server your application is deployed to.====
====Select Java and Process Management > Process Definition.====
====Select Java Virtual Machine.====
====Insert the following line into Generic JVM arguments for WebSphere 'running on JDK 8 or newer:====
{{{
-Xshareclasses:none -agentpath:<${bashs{${{jrebel.home.jar}}${{jrebel.lib}}}}$>
}}}
====Press OK. When asked, save the master configuration and restart the server.====

===Windows===
====Make sure that JRebel installation folder path does not contain spaces.====
====Start the IBM WebSphere server and open the administrative console.====
====In the Admin Console open Servers > Application servers. Select the server your application is deployed to.====
====Select Java and Process Management > Process Definition.====
====Select Java Virtual Machine.====
====Insert the following line into Generic JVM arguments for WebSphere running on JDK 8 or newer:====
{{{
-Xshareclasses:none -agentpath:<${cmds{${{jrebel.home.jar}}${{jrebel.lib}}}}$>
}}}
====Press *OK*. When asked, save the master configuration and restart the server.====
*Note:* An alternative to setting the Generic JVM arguments is to generate a simple text file with extra configuration. You can have WebSphere take advantage of this text file by using the parameter Xoptionsfile=[c:\path\to\]youroptions.txt.


==WebSphere Liberty Profile==

===Linux|macOS===
====Create the file jvm.options in your IBM WebShpere Liberty Profile ${server.config.dir} folder.====
====Add the following content to the jvm.options file:====
{{{
-agentpath:<${bashs{${{jrebel.home.jar}}${{jrebel.lib}}}}$>
}}}
====Save the file and restart the server.====
*Tip:* Create the jvm.options file in the ${wlp.install.dir}/etc/ folder to automatically apply the JVM options to all your WebShpere Liberty Profile instances.

===Windows===
====Create the file jvm.options in your IBM WebShpere Liberty Profile ${server.config.dir} folder.====
====Add the following content to the jvm.options file:====
{{{
-agentpath:<${cmds{${{jrebel.home.jar}}${{jrebel.lib}}}}$>
}}}
====Save the file and restart the server.====
*Tip:* Create the jvm.options file in the ${wlp.install.dir}/etc/ folder to automatically apply the JVM options to all your WebShpere Liberty Profile instances.


==WildFly 8.x or newer==

===Linux|macOS===
====Open $WILDFLY_HOME/bin.====
====Create the file standalone-jrebel.sh with the following content:====
{{{
#!/bin/bash
export REBEL_BASE="${{jrebel.base}}"
export REBEL_HOME="${{jrebel.home.jar}}"
export JAVA_OPTS="\"-agentpath:$REBEL_HOME${{jrebel.lib}}\" $JAVA_OPTS"
`dirname $0`/standalone.sh $@
}}}
====Use this script instead of standalone.sh to run WildFly with JRebel.====
*Warning:* Any further customization to JAVA_OPTS inside the WildFly executable (default standalone.conf.sh) needs to be included in standalone-jrebel.sh for JRebel to function correctly.

===Windows===
====Open %WILDFLY_HOME%\bin====
====Create the file standalone-jrebel.cmd with the following content:====
{{{
@echo off
set REBEL_BASE=<${cmds{${{jrebel.base}}}}$>
set REBEL_HOME=<${cmds{${{jrebel.home.jar}}}}$>
set JAVA_OPTS=-agentpath:<${cmds{%REBEL_HOME%${{jrebel.lib}}}}$> %JAVA_OPTS%
call "%~dp0\standalone.bat" %*
}}}
====Use this file instead of standalone.bat to run WildFly with JRebel.====
*Warning:* Any further customization to JAVA_OPTS inside the WildFly executable (default standalone.conf.bat) needs to be included in run-jrebel.cmd for JRebel to function correctly.
