首页 > 编程开发 > Java    日期:2021-02-06 / 浏览

1.下载JRebel and XRebel for Intellij插件

IDEA配置JRebel实现热部署的方法

2. 激活

IDEA配置JRebel实现热部署的方法
请查看这个文章http://www.cicoding.cn/other/jrebel-activation/
激活后
开始配置自动编译

IDEA配置JRebel实现热部署的方法

3.勾选Build project automatically

ctrl + shift + alt + / ,选择Registry,勾上 Compiler autoMake allow when app running

IDEA配置JRebel实现热部署的方法

4.Edit Configurations

IDEA配置JRebel实现热部署的方法

on update action和 on frame deactivation改成 update classes and resources

IDEA配置JRebel实现热部署的方法

5.打开JRebel tool

IDEA配置JRebel实现热部署的方法

6.勾选你要热部署的应用

IDEA配置JRebel实现热部署的方法

查看JRebel日志

IDEA配置JRebel实现热部署的方法

使用JRebel启动springboot项目

IDEA配置JRebel实现热部署的方法

查看控制台日志

IDEA配置JRebel实现热部署的方法

常见错误

jrebel.jar不兼容

IDEA配置JRebel实现热部署的方法

JRebel-JVMTI [ERROR] You're using an incompatible 'jrebel.jar' with the JRebel Agent.
JRebel-JVMTI [FATAL] Please make sure that'C:\Users\XXX\AppData\Roaming\JetBrains\IntelliJIdea2020.2\plugins\jr-ide-idea\lib\jrebel6\jrebel.jar' is a copy of lib JRebel ZIP release \Jrebel.jar.

这可能是因为你的IDEA可能不是最新版本,但jrebel的jar包为最新版导致的,

因此请转到官方网站下载你指定IDEA版本的JRebel压缩包。然后解压缩压缩包以找到jrebel.jar,并将jrebel使用的jar包的路径更改为解压缩后的jrebel.jar的文件路径。

IDEA配置JRebel实现热部署的方法

再次使用JRebel启动SpringBoot项目并成功启动。如果修改代码,将鼠标点向IDEA窗口以外的区域会自动build(或者手动按ctrl+shfit+F9)

IDEA配置JRebel实现热部署的方法
IDEA配置JRebel实现热部署的方法

MrBird nb

觉得上面的内容有用吗?快来点个赞吧!

点赞() 我要打赏

温馨提示 : 本站内容来自会员投稿以及互联网,所有源码及教程均为作者总结编辑,请大家在使用过程中提前做好备份,以免发生无法预知的错误,源码类教程请勿直接用于生产环境!

 可能感兴趣的文章