What's DCEVM
https://github.com/dcevm/dcevm http://hotswapagent.org/
A JVM extension for dynamically replacing code while Java is running. In combination with HotSwapAgent, it can ** reflect code changes without restarting the application **.
Since there is an IntelliJ plugin, I will write how to use it together
reference: https://github.com/dmitry-zhuravlev/hotswap-agent-intellij-plugin#dcevm-installation
There are many ways to reflect source code changes without restarting Java
If there is no change in the class structure, it will be replaced dynamically. However, it cannot be replaced when there is a change (more methods, renamed, pricvate → public, etc.)
JRebel strongest. But the price is high
Development has stopped
DCEVM + HotSwapAgent Can be replaced except for changes in parent class and interface
reference: https://github.com/dmitry-zhuravlev/hotswap-agent-intellij-plugin#dcevm-installation
DCEVM is not compatible with all versions of the JDK.
Currently (May 22, 2018), the latest supported version is Java 8u152
, so download and install this version of Java.
You can download it here. However, user registration is required to download past JDKs. http://www.oracle.com/technetwork/java/javase/downloads/java-archive-javase8-2177648.html
Download DCEVM-8u152-installer.jar
from https://github.com/dcevm/dcevm/releases/.
Start with administrator privileges
sudo java -jar DCEVM-8u152-installer.jar
Search for " HotSwapAgent
"and click Install. Restart IntelliJ after installation is complete
Open File
→Project Structure ...
, clickNew ...
→ JDK
of Project SDK`, and select the JDK installed in ↑.
Preferences
→Tools
→HotSwapAgent
Check the startup settings to enable HotSwap Agent
By the way, make sure that Hot Swap is enabled
When you start a Java application (start debugging), the HOTSWAP AGENT log appears. If you change the code in this state and compile it, it will be reflected immediately without restarting the application.
--Compile by itself (: Command + Shift + F9 / ⊞: Ctrl + Shift + F9) --Compile all (: Command + F9 / ⊞: Ctrl + F9)
Recommended Posts