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

jrebel64.dll

Windows 32-bit JDK

jrebel32.dll

Mac OS X 64-bit JDK

libjrebel64.dylib

Mac OS X 32-bit JDK

libjrebel32.dylib

Linux 64-bit JDK

libjrebel64.so

Linux 32-bit JDK

libjrebel32.so

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

  1. Add the JRebel startup parameter to the JVM arguments in your project’s build.gradle:

    if (project.hasProperty('rebelAgent')) {
      bootRun.jvmArgs += rebelAgent
    }
    
  2. 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]
    
  3. 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]"