Running servers from the command line¶
JRebel comes bundled with 64 and 32 bit libraries for JVMs, intended for use with Windows, macOS and Linux. The agent libraries can be found in the lib
folder.
Windows 64-bit JDK |
|
Windows 32-bit JDK |
|
Mac OS X 64-bit JDK |
|
Linux 64-bit JDK |
|
Linux 32-bit JDK |
|
Add the correct agent library to your server startup script using -agentpath:
. Keep reading for specific application server instructions.
Tip
Using a JRebel IDE plugin? You have access to all these snippets from Help > JRebel > Configuration > Startup.
Supported application servers¶
Cargo Maven plugin¶
Windows 64-bit¶
Use the cargo.start.jvmargs JVM system property to add the following option:
mvn cargo:run -Dcargo.start.jvmargs="-agentpath:c:\path\to]\lib\jrebel64.dll"
Windows 32-bit¶
Use the cargo.start.jvmargs JVM system property to add the following option:
mvn cargo:run -Dcargo.start.jvmargs="-agentpath:c:\path\to]\lib\jrebel32.dll"
macOS 64-bit¶
Use the cargo.start.jvmargs JVM system property to add the following option:
mvn cargo:run -Dcargo.start.jvmargs="-agentpath:/path/to/lib/libjrebel64.dylib"
Linux 64-bit¶
Use the cargo.start.jvmargs JVM system property to add the following option:
mvn cargo:run -Dcargo.start.jvmargs="-agentpath:/path/to/lib/libjrebel64.so"
Linux 32-bit¶
Use the cargo.start.jvmargs JVM system property to add the following option:
mvn cargo:run -Dcargo.start.jvmargs="-agentpath:/path/to/lib/libjrebel32.so"
GlassFish 4.x and 5.x¶
Open the GlassFish Administration Console.
Access Configuration > JVM Settings > JVM Options.
Use the Add JVM Option button to insert the following:
Windows 64-bit JDK
-agentpath:[c:\path\to]\lib\jrebel64.dll
Windows 32-bit JDK
-agentpath:[c:\path\to]\lib\jrebel32.dll
Mac OS X 64-bit JDK
-agentpath:[path/to]/lib/libjrebel64.dylib
Linux 64-bit JDK
-agentpath:[path/to]/lib/libjrebel64.so
Linux 32-bit JDK
-agentpath:[path/to]/lib/libjrebel32.so
Click Save and restart the server.
Gradle Java plugins¶
For the Gradle Application plugin, use run tasks’s jvmArgs property to add the following JVM option:
taskName.jvmArgs += '-agentpath:c:\path\to]\lib\jrebel64.dll'
In general, JRebel JVM arguments must be added to Gradle tasks of type ‘JavaExec’. Use the following JVM options in your project
build.gradle
file:
gradle.taskGraph.whenReady { taskGraph -> taskGraph.allTasks.each { task -> if (task instanceof org.gradle.api.tasks.JavaExec) { task.jvmArgs += '-agentpath:c:\path\to]\lib\jrebel64.dll' } } }
In some cases, for example, Spring Boot 3, certain tasks may need to be excluded. Use the following JVM options in your project
build.gradle
file:
gradle.taskGraph.whenReady { taskGraph -> taskGraph.allTasks.each { task -> if (task instanceof org.gradle.api.tasks.JavaExec && !["processAot"].contains(task.name)) { task.jvmArgs += '-agentpath:c:\path\to]\lib\jrebel64.dll' } } }
For the Gradle Application plugin, use run tasks’s jvmArgs property to add following JVM option:
taskName.jvmArgs += '-agentpath:c:\path\to]\lib\jrebel32.dll'
In general, JRebel JVM arguments must be added to Gradle tasks of type ‘JavaExec’. Use the following JVM options in your project
build.gradle
file:
gradle.taskGraph.whenReady { taskGraph -> taskGraph.allTasks.each { task -> if (task instanceof org.gradle.api.tasks.JavaExec) { task.jvmArgs += '-agentpath:c:\path\to]\lib\jrebel32.dll' } } }
In some cases, for example, Spring Boot 3, certain tasks may need to be excluded. Use the following JVM options in your project
build.gradle
file:
gradle.taskGraph.whenReady { taskGraph -> taskGraph.allTasks.each { task -> if (task instanceof org.gradle.api.tasks.JavaExec && !["processAot"].contains(task.name)) { task.jvmArgs += '-agentpath:c:\path\to]\lib\jrebel32.dll' } } }
For the Gradle Application plugin, use run tasks’s jvmArgs property to add following JVM option:
taskName.jvmArgs += '-agentpath:/path/to/lib/libjrebel64.dylib'
In general, JRebel JVM arguments must be added to Gradle tasks of type ‘JavaExec’. Use the following JVM options in your project
build.gradle
file:
gradle.taskGraph.whenReady { taskGraph -> taskGraph.allTasks.each { task -> if (task instanceof org.gradle.api.tasks.JavaExec) { task.jvmArgs += '-agentpath:/path/to/lib/libjrebel64.dylib' } } }
In some cases, for example, Spring Boot 3, certain tasks may need to be excluded. Use the following JVM options in your project
build.gradle
file:
gradle.taskGraph.whenReady { taskGraph -> taskGraph.allTasks.each { task -> if (task instanceof org.gradle.api.tasks.JavaExec && !["processAot"].contains(task.name)) { task.jvmArgs += '-agentpath:/path/to/lib/libjrebel64.dylib' } } }
For the Gradle Application plugin, use run tasks’s jvmArgs property to add following JVM option:
taskName.jvmArgs += '-agentpath:/path/to/lib/libjrebel64.so'
In general, JRebel JVM arguments must be added to Gradle tasks of type ‘JavaExec’. Use the following JVM options in your project
build.gradle
file:
gradle.taskGraph.whenReady { taskGraph -> taskGraph.allTasks.each { task -> if (task instanceof org.gradle.api.tasks.JavaExec) { task.jvmArgs += '-agentpath:/path/to/lib/libjrebel64.so' } } }
In some cases, for example, Spring Boot 3, certain tasks may need to be excluded. Use the following JVM options in your project
build.gradle
file:
gradle.taskGraph.whenReady { taskGraph -> taskGraph.allTasks.each { task -> if (task instanceof org.gradle.api.tasks.JavaExec && !["processAot"].contains(task.name)) { task.jvmArgs += '-agentpath:/path/to/lib/libjrebel64.so' } } }
For the Gradle Application plugin, use run tasks’s jvmArgs property to add following JVM option:
taskName.jvmArgs += '-agentpath:/path/to/lib/libjrebel32.so'
In general, JRebel JVM arguments must be added to Gradle tasks of type ‘JavaExec’. Use the following JVM options in your project
build.gradle
file:
gradle.taskGraph.whenReady { taskGraph -> taskGraph.allTasks.each { task -> if (task instanceof org.gradle.api.tasks.JavaExec) { task.jvmArgs += '-agentpath:/path/to/lib/libjrebel32.so' } } }
In some cases, for example, Spring Boot 3, certain tasks may need to be excluded. Use the following JVM options in your project
build.gradle
file:
gradle.taskGraph.whenReady { taskGraph -> taskGraph.allTasks.each { task -> if (task instanceof org.gradle.api.tasks.JavaExec && !["processAot"].contains(task.name)) { task.jvmArgs += '-agentpath:/path/to/lib/libjrebel32.so' } } }
JBoss EAP¶
Open
%JBOSS_HOME%\bin
.Create the file
standalone-jrebel.cmd
with the following content:
@echo off set REBEL_HOME=JRebel root folder. set JAVA_OPTS=-agentpath:%REBEL_HOME%\lib\jrebel64.dll %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 (defaultstandalone.conf.bat
) needs to be included instandalone-jrebel.cmd
for JRebel to function correctly.
Open
%JBOSS_HOME%\bin
.Create the file
standalone-jrebel.cmd
with the following content:
@echo off set REBEL_HOME=JRebel root folder. set JAVA_OPTS=-agentpath:%REBEL_HOME%\lib\jrebel32.dll %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 (defaultstandalone.conf.bat
) needs to be included instandalone-jrebel.cmd
for JRebel to function correctly.
Open
$JBOSS_HOME/bin
.Create the file
standalone-jrebel.sh
with the following content:
#!/bin/bash export REBEL_HOME=JRebel root folder. export JAVA_OPTS="-agentpath:$REBEL_HOME/lib/libjrebel64.dylib $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 (defaultstandalone.conf.sh
) needs to be included instandalone-jrebel.sh
for JRebel to function correctly.
Open
$JBOSS_HOME/bin
.Create the file
standalone-jrebel.sh
with the following content:
#!/bin/bash export REBEL_HOME=JRebel root folder. export JAVA_OPTS="-agentpath:$REBEL_HOME/lib/libjrebel64.so $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 (defaultstandalone.conf.sh
) needs to be included instandalone-jrebel.sh
for JRebel to function correctly.
Open
$JBOSS_HOME/bin
.Create the file
standalone-jrebel.sh
with the following content:
#!/bin/bash export REBEL_HOME=JRebel root folder. export JAVA_OPTS="-agentpath:$REBEL_HOME/lib/libjrebel32.so $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 (defaultstandalone.conf.sh
) needs to be included instandalone-jrebel.sh
for JRebel to function correctly.
Jetty 9.x¶
Jetty does not provide startup scripts for Windows. Add the following to the command line:
-agentpath:[c:\path\to\]lib\jrebel64.dll
Jetty does not provide startup scripts for Windows. Add the following to the command line:
-agentpath:[c:\path\to\]lib\jrebel32.dll
Open
$JETTY_HOME/bin
.Create the file
run-jrebel.sh
with the following content:
#!/bin/bash export REBEL_HOME=JRebel root folder. export JAVA_OPTIONS="-agentpath:$REBEL_HOME/lib/libjrebel64.dylib $JAVA_OPTIONS" `dirname $0`/jetty.sh $@
Use this script instead of
jetty.sh
to run Jetty with JRebel.
Open
$JETTY_HOME/bin
.Create the file
run-jrebel.sh
with the following content:
#!/bin/bash export REBEL_HOME=JRebel root folder. export JAVA_OPTIONS="-agentpath:$REBEL_HOME/lib/libjrebel64.so $JAVA_OPTIONS" `dirname $0`/jetty.sh $@
Use this script instead of
jetty.sh
to run Jetty with JRebel.
Open
$JETTY_HOME/bin
.Create the file
run-jrebel.sh
with the following content:
#!/bin/bash export REBEL_HOME=JRebel root folder. export JAVA_OPTIONS="-agentpath:$REBEL_HOME/lib/libjrebel32.so $JAVA_OPTIONS" `dirname $0`/jetty.sh $@
Use this script instead of
jetty.sh
to run Jetty with JRebel.
Maven Jetty plugin (mvn jetty:run)¶
To disable Jetty’s internal reloading, open the pom.xml
file and set the scanIntervalSeconds
parameter to 0
. The updated pom.xml
file should look like this:
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<configuration>
<scanIntervalSeconds>0</scanIntervalSeconds>
</configuration>
</plugin>
Add the following to the MAVEN_OPTS
environment variable:
-agentpath:[c:\path\to\]lib\jrebel64.dll
To complete this task in the console, follow these steps:
set MAVEN_OPTS=-agentpath:[c:\path\to\]lib\jrebel64.dll %MAVEN_OPTS%
mvn jetty:run
Add the following to the MAVEN_OPTS
environment variable:
-agentpath:[c:\path\to\]lib\jrebel32.dll
To complete this task in the console, follow these steps:
set MAVEN_OPTS=-agentpath:[c:\path\to\]lib\jrebel32.dll %MAVEN_OPTS%
mvn jetty:run
Add the following to the MAVEN_OPTS
environment variable:
-agentpath:[/path/to/]lib/libjrebel64.dylib
To complete this task in the console, follow these steps:
export MAVEN_OPTS="-agentpath:[/path/to/]lib/libjrebel64.dylib $MAVEN_OPTS"
mvn jetty:run
Add the following to the MAVEN_OPTS
environment variable:
-agentpath:[/path/to/]lib/libjrebel64.so
To complete this task in the console, follow these steps:
export MAVEN_OPTS="-agentpath:[/path/to/]lib/libjrebel64.so $MAVEN_OPTS"
mvn jetty:run
Add the following to the MAVEN_OPTS
environment variable:
-agentpath:[/path/to/]lib/libjrebel32.so
To complete this task in the console, follow these steps:
export MAVEN_OPTS="-agentpath:[/path/to/]lib/libjrebel32.so $MAVEN_OPTS"
mvn jetty:run
Payara 4.x and 5.x¶
Open the Payara Administration Console.
Access Configuration > JVM Settings > JVM Options.
Use the Add JVM Option to insert the following:
Windows 64-bit JDK
-agentpath:[c:\path\to]\lib\jrebel64.dll
Windows 32-bit JDK
-agentpath:[c:\path\to]\lib\jrebel32.dll
Mac OS X 64-bit JDK
-agentpath:[path/to]/lib/libjrebel64.dylib
Linux 64-bit JDK
-agentpath:[path/to]/lib/libjrebel64.so
Linux 32-bit JDK
-agentpath:[path/to]/lib/libjrebel32.so
Press Save. Restart the server.
Resin 4.x¶
Start Resin with JRebel from %RESIN_HOME%
with the parameter:
java -agentpath:[c:\path\to\]lib\jrebel64.dll -jar lib\resin.jar
Start Resin with JRebel from %RESIN_HOME%
with the parameter:
java -agentpath:[c:\path\to\]lib\jrebel32.dll -jar lib\resin.jar
Replace the last line of ${RESIN_HOME}/bin/httpd.sh
(or resin.sh
in Resin 3.2+) with the following:
java -agentpath:[/path/to/]lib/libjrebel64.dylib -jar ${RESIN_HOME}/lib/resin.jar $*
Replace the last line of ${RESIN_HOME}/bin/httpd.sh
(or resin.sh
in Resin 3.2+) with the following:
java -agentpath:[/path/to/]lib/libjrebel64.so -jar ${RESIN_HOME}/lib/resin.jar $*
Replace the last line of ${RESIN_HOME}/bin/httpd.sh
(or resin.sh
in Resin 3.2+) with the following:
java -agentpath:[/path/to/]lib/libjrebel32.so -jar ${RESIN_HOME}/lib/resin.jar $*
Spring Boot 2.x and 3.x¶
Add the JRebel startup parameter to the Spring Boot startup based on the environment. Replace the JRebel library based on the desired architecture and operating system as follows:
Windows 64-bit JDK |
|
Windows 32-bit JDK |
|
Mac OS X 64-bit JDK |
|
Linux 64-bit JDK |
|
Linux 32-bit JDK |
|
For using Spring Boot with Maven or Gradle, see JRebel with Spring Boot¶.
Spring Boot using the command line¶
Add the JRebel parameter to Spring Boot startup (replacing JRebel library as necessary):
java -agentpath:[path/to/JRebel library] -jar myapp-boot.jar
tc Server 4.x¶
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:[c:\path\to\]lib\jrebel64.dll
Use the
%SPRING_TC_HOME%\tcruntime-ctl.bat
script to start Tomcat instances as usual.
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:[c:\path\to\]lib\jrebel32.dll
Use the
%SPRING_TC_HOME%\tcruntime-ctl.bat
script to start Tomcat instances as usual.
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 line of
setenv.sh
:
REBEL_HOME=JRebel root folder. JAVA_OPTS="-agentpath:$REBEL_HOME/lib/libjrebel64.dylib $JAVA_OPTS"
Use the
$SPRING_TC_HOME/tcruntime-ctl.sh
script to start Tomcat instances as usual.
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 line of
setenv.sh
:
REBEL_HOME=JRebel root folder. JAVA_OPTS="-agentpath:$REBEL_HOME/lib/libjrebel64.so $JAVA_OPTS"
Use the
$SPRING_TC_HOME/tcruntime-ctl.sh
script to start Tomcat instances as usual.
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 line of
setenv.sh
:
REBEL_HOME=JRebel root folder. JAVA_OPTS="-agentpath:$REBEL_HOME/lib/libjrebel32.so $JAVA_OPTS"
Use the
$SPRING_TC_HOME/tcruntime-ctl.sh
script to start Tomcat instances as usual.
Tomcat 7.x, 8.x and 9.x¶
Note
The Tomcat 7.x, 8.x, 9.x and 10.x configuration instructions also apply to:
TomEE Web/Plus/PluME 1.7.x and 7.x and newer
Liferay for Tomcat 7.x and newer
Open
%TOMCAT_HOME%\bin
.Create the file
catalina-jrebel.bat
with the following content:
@echo off set REBEL_HOME=JRebel root folder. set JAVA_OPTS=-agentpath:%REBEL_HOME%\lib\jrebel64.dll %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, open tomcatXw.exe
wrapper (or double click the Tomcat icon in the system tray). Insert the following line in Java > Java Options:
-agentpath:[c:\path\to\]lib\jrebel64.dll
Open
%TOMCAT_HOME%\bin
.Create the file
catalina-jrebel.bat
with the following content:
@echo off set REBEL_HOME=JRebel root folder. set JAVA_OPTS=-agentpath:%REBEL_HOME%\lib\jrebel32.dll %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, open tomcatXw.exe
wrapper (or double click the Tomcat icon in the system tray). Insert the following line in Java > Java Options:
-agentpath:[c:\path\to\]lib\jrebel32.dll
Open
$TOMCAT_HOME/bin
.Create the file
catalina-jrebel.sh
with the following content:
#!/bin/bash export REBEL_HOME=JRebel root folder. export JAVA_OPTS="-agentpath:$REBEL_HOME/lib/libjrebel64.dylib $JAVA_OPTS" `dirname $0`/catalina.sh $@
Use
catalina-jrebel.sh
to run Tomcat with JRebel.
./catalina-jrebel.sh run
Open
$TOMCAT_HOME/bin
.Create the file
catalina-jrebel.sh
with the following content:
#!/bin/bash export REBEL_HOME=JRebel root folder. export JAVA_OPTS="-agentpath:$REBEL_HOME/lib/libjrebel64.so $JAVA_OPTS" `dirname $0`/catalina.sh $@
Use
catalina-jrebel.sh
to run Tomcat with JRebel.
./catalina-jrebel.sh run
Open
$TOMCAT_HOME/bin
.Create the file
catalina-jrebel.sh
with the following content:
#!/bin/bash export REBEL_HOME=JRebel root folder. export JAVA_OPTS="-agentpath:$REBEL_HOME/lib/libjrebel32.so $JAVA_OPTS" `dirname $0`/catalina.sh $@
Use
catalina-jrebel.sh
to run Tomcat with JRebel.
./catalina-jrebel.sh run
WebLogic 12.x¶
Open
%DOMAIN_HOME%\bin
.Create the file
startWeblogic-jrebel.cmd
with the following content:
@echo off set REBEL_HOME=JRebel root folder. set JAVA_OPTIONS=-agentpath:%REBEL_HOME%\lib\jrebel64.dll %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.
Open
%DOMAIN_HOME%\bin
.Create the file
startWeblogic-jrebel.cmd
with the following content:
@echo off set REBEL_HOME=JRebel root folder. set JAVA_OPTIONS=-agentpath:%REBEL_HOME%\lib\jrebel32.dll %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.
Open
$DOMAIN_HOME/bin
.Create the file
startWeblogic-jrebel.sh
with the following content:
#!/bin/bash export REBEL_HOME=JRebel root folder. export JAVA_OPTIONS="-agentpath:$REBEL_HOME/lib/libjrebel64.dylib $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.
Open
$DOMAIN_HOME/bin
.Create the file
startWeblogic-jrebel.sh
with the following content:
#!/bin/bash export REBEL_HOME=JRebel root folder. export JAVA_OPTIONS="-agentpath:$REBEL_HOME/lib/libjrebel64.so $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.
Open
$DOMAIN_HOME/bin
.Create the file
startWeblogic-jrebel.sh
with the following content:
#!/bin/bash export REBEL_HOME=JRebel root folder. export JAVA_OPTIONS="-agentpath:$REBEL_HOME/lib/libjrebel32.so $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.
WebSphere 8.x and 9.x¶
Make sure that the JRebel installation path does not contain spaces.
Start the IBM WebSphere server and open the administrative console.
Under 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 8.x or later running on IBM JDK 6 or newer:
-Xshareclasses:none -agentpath:[c:\path\to\]lib\jrebel64.dll
Click OK. 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
.
Make sure that the JRebel installation path does not contain spaces.
Start the IBM WebSphere server and open the administrative console.
Under 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 8.x or later running on IBM JDK 6 or newer:
-Xshareclasses:none -agentpath:[c:\path\to\]lib\jrebel32.dll
Click OK. 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
.
Start the IBM WebSphere server and open the administrative console.
Under 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 8.x or later running on IBM JDK 6 or later:
-Xshareclasses:none -agentpath:[/path/to/]lib/libjrebel64.dylib
Click OK. Save the master configuration and restart the server.
Start the IBM WebSphere server and open the administrative console.
Under 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 8.x or later running on IBM JDK 6 or later:
-Xshareclasses:none -agentpath:[/path/to/]lib/libjrebel64.so
Click OK. Save the master configuration and restart the server.
Start the IBM WebSphere server and open the administrative console.
Under 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 8.x or later running on IBM JDK 6 or later:
-Xshareclasses:none -agentpath:[/path/to/]lib/libjrebel32.so
Click OK. Save the master configuration and restart the server.
WebSphere Liberty Profile¶
Create the file
jvm.options
in your IBM WebSphere Liberty Profile${server.config.dir}/
folder.Add the following content to the
jvm.options
file:
-agentpath:[c:\path\to\]lib\jrebel64.dll
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.
Create the file
jvm.options
in your IBM WebSphere Liberty Profile${server.config.dir}/
folder.Add the following content to the
jvm.options
file:
-agentpath:[c:\path\to\]lib\jrebel32.dll
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.
Create the file
jvm.options
in your IBM WebSphere Liberty Profile${server.config.dir}/
folder.Add the following content to the
jvm.options
file:
-agentpath:[/path/to/]lib/libjrebel64.dylib
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.
Create the file
jvm.options
in your IBM WebSphere Liberty Profile${server.config.dir}/
folder.Add the following content to the
jvm.options
file:
-agentpath:[/path/to/]lib/libjrebel64.so
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.
Create the file
jvm.options
in your IBM WebSphere Liberty Profile${server.config.dir}/
folder.Add the following content to the
jvm.options
file:
-agentpath:[/path/to/]lib/libjrebel32.so
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, 9.x and 10.x¶
Open
%WILDFLY_HOME%\bin
.Create the file
standalone-jrebel.cmd
with the following content:
@echo off set REBEL_HOME=JRebel root folder. set JAVA_OPTS=-agentpath:%REBEL_HOME%\lib\jrebel64.dll %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 (defaultstandalone.conf.bat
) needs to be included inrun-jrebel.cmd
for JRebel to function correctly.
Open
%WILDFLY_HOME%\bin
.Create the file
standalone-jrebel.cmd
with the following content:
@echo off set REBEL_HOME=JRebel root folder. set JAVA_OPTS=-agentpath:%REBEL_HOME%\lib\jrebel32.dll %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 (defaultstandalone.conf.bat
) needs to be included inrun-jrebel.cmd
for JRebel to function correctly.
Open
$WILDFLY_HOME/bin
.Create the file
standalone-jrebel.sh
with the following content:
#!/bin/bash export REBEL_HOME=JRebel root folder. export JAVA_OPTS="-agentpath:$REBEL_HOME/lib/libjrebel64.dylib $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 (defaultstandalone.conf.sh
) needs to be included instandalone-jrebel.sh
for JRebel to function correctly.
Open
$WILDFLY_HOME/bin
.Create the file
standalone-jrebel.sh
with the following content:
#!/bin/bash export REBEL_HOME=JRebel root folder. export JAVA_OPTS="-agentpath:$REBEL_HOME/lib/libjrebel64.so $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 (defaultstandalone.conf.sh
) needs to be included instandalone-jrebel.sh
for JRebel to function correctly.
Open
$WILDFLY_HOME/bin
.Create the file
standalone-jrebel.sh
with the following content:
#!/bin/bash export REBEL_HOME=JRebel root folder. export JAVA_OPTS="-agentpath:$REBEL_HOME/lib/libjrebel32.so $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 (defaultstandalone.conf.sh
) needs to be included instandalone-jrebel.sh
for JRebel to function correctly.
Enabling JRebel for Tomcat and WildFly using the JRebel CLI commands¶
Starting in JRebel 2024.4.2, you can enable JRebel for the Tomcat and Wildfly application servers using the JRebel CLI commands.
To automatically perform the steps reference in the sections above, run the JRebel CLI tool with the -enable-jrebel
command and specify the application server installation location as a command parameter. For example:
java -jar /path/to/jrebel.jar -enable-jrebel /path/to/application-server
This will create a JRebel-specific server startup file that can be used to start the application server with JRebel agent. For example, for the Tomcat server, the file will be named catalina-jrebel.sh
or catalina-jrebel.bat
.
In addition, the optional -sticky
parameter supports the CLI tool in creating a “sticky configuration change” where the original application server startup file can be used to start the application server with JRebel agent.
This is accomplished by renaming the original startup file and storing JRebel-specific configurations with the name of original file. In this scenario, the JRebel startup file is delegating the server startup commands to the renamed file. For example:
java -jar /path/to/jrebel.jar -enable-jrebel -sticky /path/to/apache-tomcat-server
This will rename the original catalina.bat/sh
file to catalina-stickyJRebelTarget.bat/sh
. JRebel-specific configuration is stored inside the catalina.sh/bat
file that can be used to start the application server with JRebel agent.
This configuration is useful when external tooling is configured to use catalina.sh/bat
files and you want to use JRebel agent without modifying external tooling configuration.
The changes made with the -enable-jrebel
JRebel CLI command can be reverted with the -disable-jrebel
command. For example:
java -jar /path/to/jrebel.jar -disable-jrebel /path/to/application-server