Backend Development 11 min read

Using JRebel for Local and Remote Hot Deployment in Spring Boot

This article explains how to install and configure JRebel for both local and remote hot deployment in Spring Boot projects, compares it with Spring DevTools, and provides step‑by‑step instructions, code snippets, and troubleshooting tips for multi‑module applications.

Code Ape Tech Column
Code Ape Tech Column
Code Ape Tech Column
Using JRebel for Local and Remote Hot Deployment in Spring Boot

Preface

Spring Boot developers most often use devtools for hot deployment because it is officially supported. However, JRebel offers faster loading and a more convenient experience, making it a superior choice for many developers.

As a "senior‑level" development tool, JRebel deserves a dedicated section.

How to Bypass JRebel Licensing?

The author previously wrote a tutorial on activating JRebel . Readers without a license can refer to that article via the provided link.

Statement: The author recommends the official version for those who can afford it, as the tool is worth the price.

What Is Local Hot Deployment?

In traditional development, code changes require stopping and restarting the application to take effect.

Local hot deployment detects specific file modifications while the application is running and applies them without a restart.

What Is Remote Hot Deployment?

The term "remote" refers to a remote server. Normally, after local code changes, developers must rebuild, upload, and restart the server to see the changes.

Remote hot deployment updates the server automatically when local code changes, eliminating the need for manual rebuilds and restarts.

Images illustrate the concept.

Differences Between JRebel and DevTools

If JRebel were free, it would be the default choice for all developers. The main differences are:

JRebel loads faster than devtools .

JRebel works with any Java project, not only Spring Boot.

devtools cannot hot‑replace newly added methods or changed method signatures, while JRebel can.

How to Install JRebel?

For local hot deployment, install the JRebel plugin in IDEA. For remote hot deployment, install JRebel on the server. Both procedures are described in the linked article.

How to Perform Local Hot Deployment?

After installing the JRebel plugin, enable "Build automatically" in IDEA, then open the JRebel tool panel, select the project or module to hot‑deploy, and confirm.

After selection, a rebel.xml file is generated under src/resource .

Right‑click the Spring Boot main class and choose the JRebel launch option.

The IDEA toolbar also provides a launch button.

① starts the application locally in DEBUG mode; ② triggers remote hot deployment.

Press CTRL+SHIFT+F9 after making changes; JRebel recompiles and reloads the modified parts without restarting.

How to Perform Remote Hot Deployment?

Install and activate JRebel on the server (see the previous article). Set a remote password by running:

java -jar jrebel.jar -set-remote-password 123456789
The password 123456789 must be used when configuring the IDEA remote connection.

Configure the remote module in IDEA's JRebel panel.

After selection, a rebel-remote.xml file is created under src/resource .

Package the Spring Boot project as a JAR, upload it to the server, and start it with:

nohup java -agentpath:/usr/local/jrebel/lib/libjrebel64.so  -Drebel.remoting_plugin=true -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9083 -jar xxx.jar &

The libjrebel64.so file comes from JRebel's lib directory. The -Xdebug and related options enable remote debugging; they can be omitted if not needed.

After the server starts, the remote configuration is complete.

In IDEA, add a remote server under File → Settings → JRebel → Remote Servers :

Click the + button to add a service.

Enter the server name, URL ( http://ip:port ), and the remote password set earlier.

Click OK to finish.

After configuration, click the remote deployment button ( ② ) in the JRebel toolbar; the server code updates automatically.

The JRebel Console displays logs of the remote hot‑deployment process.

Whenever local changes are made, clicking the remote hot‑deployment button uploads the changes to the server instantly, without restarting the application.

A Pitfall in Multi‑Module Development

In a multi‑module project (e.g., api , core , service ), only the api module is packaged as the final JAR. Even if all modules are checked in JRebel's remote options, changes in core or service will not take effect on the server.

To solve this, edit the rebel-remote.xml file in the api project and add the other modules' package names:

<?xml version="1.0" encoding="UTF-8"?>
<rebel-remote xmlns="http://www.zeroturnaround.com/rebel/remote">
    <id>xx.xx.xx.api</id>
    <id>xx.xx.xx.service</id>
    <id>xx.xx.xx.core</id>
</rebel-remote>
The <id> tags specify the package names of the modules to be hot‑deployed.

Conclusion

As a veteran hot‑deployment tool, JRebel still outperforms newer alternatives. The article hopes readers can improve development efficiency with JRebel.

The author also offers a 10 MB interview guide covering various backend topics; reply with "Java面试宝典" in the public account to receive it.

JavaSpring BootIDEAremote debuggingJRebelHot Deployment
Code Ape Tech Column
Written by

Code Ape Tech Column

Former Ant Group P8 engineer, pure technologist, sharing full‑stack Java, job interview and career advice through a column. Site: java-family.cn

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.