Get True Hot Swap in Java with DCEVM and IntelliJ IDEA
Many developers can barely imagine daily work on large projects without hot-swapping Java classes from the IDE. However, as you know Java HotSwap™ VM has a serious limitation since no structural changes in classes are allowed. This means that you can’t, say, add a new method or a field to a class and perform the hot swapping. The only thing you can actually change during the hot swapping are the method bodies.
Luckily there is a way to improve the situation with the new open-source project Dynamic Code Evolution VM, a modification of Java HotSwap™ VM with unlimited support for reloading classes at runtime.
We have already tested the new virtual machine in a local environment for IntelliJ IDEA project development and can confirm that it delivers significant productivity gains.
The support for Dynamic Code Evolution VM in IntelliJ IDEA is available now for everyone via this new plugin so you can try the true hot swapping by yourself.
Follow these steps to get started with this plugin:
When you enable the plugin, the IDE will offer you to download DCEVM JRE for your environment.
Then, if you want to use this JRE for your run configurations, you have to choose it in the list of alternative JREs.
Now you can enjoy the enhanced hot swapping in your project.
It’s important to note that DCEVM is still a prototype project at the moment and it’s not ready for use in production servers. However, it is of excellent help during development. If DCEVM JEP has enough interest, it may be incorporated into the standard JVM distribution later.
Develop with Pleasure!