JRebel 能做什么?
JRebel 是一款热部署插件。当你的 Java-web 项目在 tomcat 中 run/debug 的时候 ,修改某一个 java 文件时,tomcat 并不能将此文件的修改实时编译 并反映到运行的项目中去。JRebel 就可以解决在项目运行状态run/debug 状态
下任意修改 java 文件并动态反馈到运行的项目中。
或许你说你可以这样干,修改 server.xml 的配置。
<Context path="/helloapp" docBase="helloapp" reloadable="true"/>
但改动 java 代码后果是 tomcat 会重启整个项目。
直奔主题
一,JRebel 插件 获取与安装
1,JRebel 官网下载地址
https://zeroturnaround.com/software/jrebel/download/#!/free-trial
![](https://i-blog.csdnimg.cn/blog_migrate/0c293fa90f146c9256f5b95412a357f0.webp?x-image-process=image/format,png)
注册可以获得 14 天的免费使用,注册过程此处省略 N 个字,注册下载相信大家都会。收费的问题下面会为大家解决,不用急。
下载好了如何安装?
![](https://i-blog.csdnimg.cn/blog_migrate/59cb31db6a79cc88a55109219564b1f8.webp?x-image-process=image/format,png)
这里我就随便拿一个来演示本地安装了。
![](https://i-blog.csdnimg.cn/blog_migrate/d6be1760749f3ac9e42de34b33bb3eb4.webp?x-image-process=image/format,png)
![](https://i-blog.csdnimg.cn/blog_migrate/4ebb8d02db35d321eccdc7b51df7b43a.webp?x-image-process=image/format,png)
2,或者直接在 IDEA 中操作获取 JRebel 插件
![](https://i-blog.csdnimg.cn/blog_migrate/7a499278b429f9acbd84fc44ea8027c5.webp?x-image-process=image/format,png)
![](https://i-blog.csdnimg.cn/blog_migrate/bdf73a4baaa4bf52085a03fc0495d8b2.webp?x-image-process=image/format,png)
安装完成,记得重启 IDEA 使刚才安装的插件生效。
二,激活
![](https://i-blog.csdnimg.cn/blog_migrate/bb1643be52cc55b1da91df7f859dc769.webp?x-image-process=image/format,png)
![](https://i-blog.csdnimg.cn/blog_migrate/835fff8c2709791cab3b4db14d998344.webp?x-image-process=image/format,png)
http://idea.lanyus.com/ilanyu
lanyu19950316@gmail.com
在此感谢 IDEA开源社区 http://www.ideajava.org/
![](https://i-blog.csdnimg.cn/blog_migrate/193b927d09775504061b36e36e1dff06.webp?x-image-process=image/format,png)
![](https://i-blog.csdnimg.cn/blog_migrate/52ac950b8656c95546954630c2426465.webp?x-image-process=image/format,png)
三:使用
![](https://i-blog.csdnimg.cn/blog_migrate/34e8bf3c2993d62ac340ab6b511849b5.webp?x-image-process=image/format,png)
![](https://i-blog.csdnimg.cn/blog_migrate/d77be6b79c404076f325500c236896da.webp?x-image-process=image/format,png)
![](https://i-blog.csdnimg.cn/blog_migrate/6a3b175c278e68d648f053db31a52597.webp?x-image-process=image/format,png)
![](https://i-blog.csdnimg.cn/blog_migrate/9f4b9d4b1c625e0ee31cd041424e0fe2.webp?x-image-process=image/format,png)
配置完毕!
![](https://i-blog.csdnimg.cn/blog_migrate/c9f7b52c876d72da1867bfd5750e1784.webp?x-image-process=image/format,png)
Paste_Image.png
启动项目之后
任意修改 java 代码,并 ctrl + s 保存 ,update classes and resources 一下。
![](https://i-blog.csdnimg.cn/blog_migrate/c55de70811ddfd37b69320631a9066e2.webp?x-image-process=image/format,png)
操作如下所示:
![](https://i-blog.csdnimg.cn/blog_migrate/e299b9636488fc57bc923ea90dd8aa81.webp?x-image-process=image/format,png)