您的位置:首页 > 其它

Intellij IDEA 本地安装jrebel插件

2017-01-09 00:00 549 查看
jrebel(http://zeroturnaround.com/)的作用就是当你的代码改变时,你不需要重启服务,节省了时间。代码的改变有很多种,比如增加class、在class中增加方法等等。下面介绍一下 Java 开发利器 intellij idea 怎样安装 jrebel。

1.安装 jrebel 插件

在 intellij idea 中,打开 File - Settings(ctrl + alt + s),点击弹出的对话框中的 plugins。



点击对话框底部中间的按钮 Browse repositories...,在弹出的对话框中可以搜索你需要的插件。我们搜索 jrebel。



搜索后,会显示两个 jrebel 的插件。我们安装 JRebel for Intellij,选中此插件,对话框右边有个绿色的 install plugin 按钮。点击安装即可。 安装完成之后,需要重启 intellij idea。

安装好后,在 intellij idea 的右上角,有两个 jrebel 的图标。一个是正常启动模式,一个是 debug 模式。



2.破解 jrebel

jrebel唯一不好的地方就是收费的

。对于我等屌丝的话,只能默默破解了。我现在jrebel使用的版本是6.2.5。点击这里,下载jrebel破解版。解压破解文件后,将

jrebel.lic 复制到 C:\Users\你的用户名\.jrebel 下

jrebel.jar 复制到 C:\Users\你的用户名\.IntelliJIdea14\config\plugins\jr-ide-idea\lib\jrebel 下

打开 intellij idea(如果破解的时候,你的 intellij idea 是打开的,则需要重启),点击 File - Settings(ctrl + alt + s),点击 弹出对话框的 JRebel。右边的 License 显示 VALID,表示破解成功。恭喜!



3.使用 JRebel

打开 intellij idea 左下角的 JRebel 选项卡,这里可以看到你的项目。如果你的项目想使用jrebel,勾选项目下的复选框即可。



设置 tomcat 选项,点击 intellij idea 右上角。



在 弹出的对话框 中,修改 红色框的内容,保存即可。



点击

中的一个,启动服务吧。

服务启动后,当你修改一个class 后,控制台 显示 JRebel: Reloading class ...,说明 jrebel 已经发挥作用了。

--------------------------------------------------------------------------------------------------------------------------------------------------------------------

2015-10-20 更新

如果修改了 class,jrebel 没有自动部署。那就设置一下 代码编译 后的输出目录。

1.打开 项目结构(ctrl + shfit + alt + s) 对话框,修改 class 的输出目录到 web 的 classes 下。



2.生成 jrebel 配置文件。在项目上右键 - jrebel - jrebel.xml。



3.重启服务即可。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息