Install/configure JRebel Agent

The simplest way to install JRebel is to download the “standalone” installation package from the JRebel download page. Unzip the downloaded file to a convenient location within your user’s directory - for example, ~/bin/jrebel

The installation directory will contain a lib directory containing the agent files. The appropriate agent based on your operating system, following the table below:

Table 1. JRebel Agent
OSAgent

Windows 64-bit JDK

[jrebel directory]\lib\jrebel64.dll

Windows 32-bit JDK

[jrebel directory]\lib\jrebel32.dll

Mac OS X 64-bit JDK

[jrebel directory]/lib/libjrebel64.dylib

Mac OS X 32-bit JDK

[jrebel directory]/lib/libjrebel32.dylib

Linux 64-bit JDK

[jrebel directory]/lib/libjrebel64.so

Linux 32-bit JDK

[jrebel directory]/lib/libjrebel32.so

Note the path to the appropriate agent, and add the value to your project build.

Gradle

Add the path to gradle.properties (create the file if necessary), as the rebelAgent property.

gradle.properties

  1. #Assuming installation path of ~/bin/jrebel/
  2. rebelAgent= -agentpath:~/bin/jrebel/lib/libjrebel64.dylib

Add the appropriate JVM arg to build.gradle (not necessary if using the CLI feature)

  1. run.dependsOn(generateRebel)
  2. if (project.hasProperty('rebelAgent')) {
  3. run.jvmArgs += rebelAgent
  4. }

You can start the application with ./gradlew run, and it will include the agent. See the section on Gradle Reloading or IDE Reloading to set up the recompilation.

Maven

Configure the Micronaut Maven Plugin accordingly:

  1. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  2. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  3. <!-- ... -->
  4. <build>
  5. <plugins>
  6. <!-- ... -->
  7. <plugin>
  8. <groupId>io.micronaut.build</groupId>
  9. <artifactId>micronaut-maven-plugin</artifactId>
  10. <configuration>
  11. <jvmArguments>
  12. <jvmArgument>-agentpath:~/bin/jrebel/lib/jrebel6/lib/libjrebel64.dylib</jvmArgument>
  13. </jvmArguments>
  14. </configuration>
  15. </plugin>
  16. <plugin>
  17. <groupId>org.zeroturnaround</groupId>
  18. <artifactId>jrebel-maven-plugin</artifactId>
  19. <version>1.1.8</version>
  20. <executions>
  21. <execution>
  22. <id>generate-rebel-xml</id>
  23. <phase>process-resources</phase>
  24. <goals>
  25. <goal>generate</goal>
  26. </goals>
  27. </execution>
  28. </executions>
  29. </plugin>
  30. <!-- ... -->
  31. </plugins>
  32. </build>
  33. </project>