The only required configuration file for JRebel is the rebel.xml file. This file allows JRebel to map your running application to your workspace, enabling dynamic class reloading and efficient development. Fortunately, the JRebel IDE plugin can automate this setup for you. In this example, we’ll walk through the steps using IntelliJ IDEA.
To begin, open the Project view in IntelliJ. Right-click on your project, hover over the JRebel menu, and select Enable JRebel. This action generates a dedicated rebel.xml configuration file for each module in your project. These files will be visible directly within your source tree, so you can confirm that JRebel is properly configured.
For Maven projects, the generated configuration files are typically placed under src/main/resources. During the build process, they’re automatically picked up and included in your application. It’s important to note that the rebel.xml file must be deployed alongside the application within the application container for JRebel to function as expected.
Additionally, keep in mind that IntelliJ does not compile classes on save by default, which can impact your JRebel workflow. Also, JRebel and IntelliJ’s HotSwap feature are not designed to work together. To avoid conflicts, disable HotSwap by going to Settings (top right corner), searching for “HotSwap,” and ensuring that Reload classes after compilation is set to Never or Ask.
Once you’ve generated the rebel.xml file and updated your project settings, redeploy your application to the server so the new configuration takes effect. IntelliJ also provides a JRebel tool window (typically found at the bottom left) that offers an overview of all JRebel configurations for the active project. From this window, you can manage checkboxes to control rebel.xml generation and monitor your setup.