一開始用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