JRebel with Spring Boot¶
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 |
|
Mac OS X 32-bit JDK |
|
Linux 64-bit JDK |
|
Linux 32-bit JDK |
|
JRebel also needs the rebel.xml
configuration file to map workspace to a deployed application. You can read more about generating the configuration file here.
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
Spring Boot using Gradle¶
Add the JRebel startup parameter to the JVM arguments in your project’s
build.gradle
:if (project.hasProperty('rebelAgent')) { bootRun.jvmArgs += rebelAgent }
Define the absolute path to the JRebel library on your local machine. Add this to
~/.gradle/gradle.properties
(create the file if it does not exist), replacing JRebel library path as necessary:rebelAgent=-agentpath:[path/to/JRebel library]
Start the application using
gradle bootRun
.
Spring Boot 1.x using Maven¶
Add the following to the Maven run command (replacing JRebel library as necessary):
mvn spring-boot:run -Drun.jvmArguments="-agentpath:[/path/to/JRebel library]"
Spring Boot 2.x using Maven¶
Add the following to the Maven run command (replacing JRebel library as necessary):
mvn spring-boot:run -Dspring-boot.run.jvmArguments="-agentpath:[/path/to/JRebel library]"