一开始用eclipse的时候虽然这是一个狂吃内存的家伙,但是调试代码是真的舒服,修改过的代码可以不用重启热加载,后来转idea,虽然idea很完美但是也有不足的地方,比如代码调试就不能热加载。
还好有第三方插件,话不多言,亲测可用
激活地址填写:https://jrebel.qekang.com/{GUID}
在线GUID地址:https://www.guidgen.com/
邮箱需要填写真实邮箱
激活之后,在设置里面将工作模式设置为offline就可以了
参考链接:https://www.cnblogs.com/babyshe/articles/12605174.html
附:如果试用jreble同时还想整合JProfiler来监测性能相关的参数,可以在jrebel的配置项里面添加一行参数,当然前提是你已经安装了JProfiler
这里我用的时jrebel Debug模式,如果不想在debug模式下,配置非debug模式就可以了-agentpath:D:\software\jprofiler11\bin\windows-x64\jprofilerti.dll=port=8849,nowait,id=81,config=C:\Users\Vincente\.jprofiler11\jprofiler_config.xml
- 注意你的.dll 文件路径和 config.xml的路径
正常启动可以看到控制台输出:
- Tomcat启动 --> 加载 JProfiler --> 加载Jrebel --> 加载Xrebel
Using CATALINA_BASE: "C:\Users\Vincente\.IntelliJIdea2019.3\system\tomcat\Unnamed_my-study-platform"
Using CATALINA_HOME: "D:\develop\tomcat\apache-tomcat-7.0.35"
Using CATALINA_TMPDIR: "D:\develop\tomcat\apache-tomcat-7.0.35\temp"
Using JRE_HOME: "C:\Program Files\Java\jdk1.8.0_241"
Using CLASSPATH: "D:\develop\tomcat\apache-tomcat-7.0.35\bin\bootstrap.jar;D:\develop\tomcat\apache-tomcat-7.0.35\bin\tomcat-juli.jar"
JProfiler> Protocol version 63
JProfiler> Java 8 detected.
JProfiler> Don't wait for frontend to connect.
JProfiler> 64-bit library
JProfiler> Using config file C:\Users\Vincente\.jprofiler11\jprofiler_config.xml (id: 81)
JProfiler> Listening on port: 8849.
JProfiler> Enabling native methods instrumentation.
JProfiler> Can retransform classes.
JProfiler> Can retransform any class.
JProfiler> Native library initialized
2020-08-24 10:45:25 JRebel: Starting logging to file: C:\Users\Vincente\.jrebel\jrebel.log
2020-08-24 10:45:25 JRebel:
2020-08-24 10:45:25 JRebel: #############################################################
2020-08-24 10:45:25 JRebel:
2020-08-24 10:45:25 JRebel: JRebel Agent 2020.2.4 (202007241243)
2020-08-24 10:45:25 JRebel: (c) Copyright 2007-2020 Perforce Software, Inc.
2020-08-24 10:45:25 JRebel:
2020-08-24 10:45:25 JRebel: Over the last 30 days JRebel prevented
2020-08-24 10:45:25 JRebel: at least 796 redeploys/restarts saving you about 0.4 hours.
2020-08-24 10:45:25 JRebel:
2020-08-24 10:45:25 JRebel: License acquired from License Server: https://jrebel.qekang.com
2020-08-24 10:45:25 JRebel:
2020-08-24 10:45:25 JRebel: Licensed to Vincente.
2020-08-24 10:45:25 JRebel:
2020-08-24 10:45:25 JRebel: You are using an offline license.
XRebel: Starting logging to file: C:\Users\Vincente\.xrebel\xrebel.log
2020-08-24 10:45:25 JRebel:
2020-08-24 10:45:25 JRebel:
2020-08-24 10:45:25 JRebel: #############################################################
2020-08-24 10:45:25 JRebel:
XRebel:
XRebel: ################################################################
XRebel:
XRebel: XRebel 2020.2.0 (202006020843)
XRebel: (c) Copyright ZeroTurnaround AS, Estonia, Tallinn.
XRebel:
XRebel: For questions and support, contact xrebel@zeroturnaround.com
XRebel:
XRebel: ################################################################
XRebel:
JProfiler> VM initialized
JProfiler> Using instrumentation
JProfiler> Time measurement: elapsed time
JProfiler> CPU profiling enabled