Hot Reload beta
The written code can be made effective without restarting the application. It supports changes in properties and methods of classes (including proxy classes), SpringBoot, MybatisPlus, etc., to improve development efficiency.
Enable hot reload
Click The icon changes to
to turn on hot reload. Start the project in the big airplane mode and hot reload will take effect.
- Off status
- On status
If the prompt DCEVM is not installed
is prompted when starting the project, check whether the command java -XXaltjvm=dcevm -version
can be output normally. If not, you need to install DCEVM first.
Use hot reload
Start the project in the state of the big plane, the project outputs the following log, and prints the loaded hot reload plug-in.
DebugTools: 2025-01-07 16:41:07.909 INFO [main] i.g.f.d.t.h.c.HotswapAgent 44 : open hot reload unlimited runtime class redefinition.{3.3.0}
DebugTools: 2025-01-07 16:41:08.498 INFO [main] i.g.f.d.t.h.c.c.PluginRegistry 132 : Discovered plugins: [JdkPlugin, ClassInitPlugin, AnonymousClassPatch, WatchResources, HotSwapper, Proxy, Spring, MyBatis]
After writing the code, hot reload is automatically triggered after compiling the project through idea (explore the idea shortcut keys yourself).
- Start the project in
Run
mode. You can compile the project in the following way to trigger hot reload
- Start the project in
Debug
mode. Not only can you compile the project in the above Run way to trigger hot reload, you can also recompile the class in theCompile and Reload Modified Files
way in the right-click menu to trigger hot reload.
Xml
files can also compile the project to trigger hot reload through the above Run method, and can also trigger hot reload separately through theCompile 'xxx.xml' to Target
method in the right-click menu.
The console will output relevant hot reload information.
DebugTools: 2025-01-07 16:50:22.205 RELOAD [Thread-26] i.g.f.d.t.h.c.p.s.s.ClassPathBeanDefinitionScannerAgent 210 : Registered Spring bean 'testController'
In what situations can hot reload be used
Ordinary class files
- Add new class files
- Add/modify properties/methods/inner classes in existing classes.
- Anonymous inner class
- Enum class
Click Hot reload of class files for details
Proxy class
Java JDK proxy class.
Cglib proxy class.
Click Hot reload proxy class for details
SpringBoot Bean
- Controller
- Service
- Component
- Repository
Click SpringBoot for details
MyBatis
Mapper (create/modify)
Xml (create/modify)
TIP
MyBatis currently supports the Spring
environment, other situations are unknown.
Click MyBatis for details
MyBatisPlus
Entity (create/modify)
Mapper (create/modify)
Xml (create/modify)
TIP
MyBatisPlus currently supports the Spring
environment, other situations are unknown.
Click MyBatisPlus for details
Install DCEVM
java 8
window/mac
Download the .jar file for the corresponding version. Currently only the following versions of JDK are supported, please select the corresponding version.
Run the corresponding java -jar DCEVM-8uXX-installer.jar
file, find the corresponding version, and click the Install DCEVM as altjvm
button.
linux
For example, if you enter java -XXaltjvm=dcevm -version
, you will get the following prompt
Error: missing `dcevm' JVM at `/home/java/jdk1.8.0_291/jre/lib/amd64/dcevm/libjvm.so'.
Please install or use the JRE or JDK that contains these missing components.
Download the corresponding version of the file and rename it to libjvm.so
and move it to the directory extracted above.
java version | download by debug tools | download by github |
---|---|---|
>= 1.8.0_181 | libjvm181.so | libjvm181.so |
1.8.0_172 | libjvm172.so | libjvm172.so |
1.8.0_152 | libjvm152.so | libjvm152.so |
1.8.0_144 | libjvm144.so | libjvm144.so |
1.8.0_112 | libjvm112.so | libjvm112.so |
1.8.0_92 | libjvm92.so | libjvm92.so |
1.8.0_74 | libjvm74.so | libjvm74.so |
<= 1.8.0_66 | libjvm66.so | libjvm66.so |
java 11
Download trava-jdk-11-dcevm for use as jdk11.
java 17/21
Download JetBrainsRuntime for use with jdk17/21.
TIP
If the Apple system prompts that the JDK is damaged or the developer cannot be verified after downloading it, and the JDK cannot be started, enter sudo xattr -r -d com.apple.quarantine /$jdkPath
, where $jdkPath is your JDK directory