Using DCEVM and Hotswap for rapid turnaround

Version 4.1 by Samuel Pelletier on 2016/06/12 17:17

DCEVM and Hotswap enable rapid turnaround by allowing almost any class change to the running VM. It offers an experience very similar to JRebel for WebObjects developers. With this tool, you usually do not have to restart your application after code change.

Prerequisites

  • A JRE patched with the DCEVM
  • The Hotwsap agent to handle the WebObjects caches.

Patching the VM

DCEVM is the patch that enable the enhanced class redefinition in the VM. Download the installer for your JRE version and install the alternative VM. The patch is not always available for the latest update of the JRE, you may try the latest update available but it may not works. At the time I write this, the patch for Java 1.8 update 92 works as expected.

DCEVM download site: http://dcevm.github.io

Launch the installer as root


sudo java -jar DCEVM-light-8u92-installer.jar

Click "Add installation directory..." and select your JRE Home.

DCEVM installer.png

Click "Install DCEVM ad altvm"

Quit the installer by closing the window.

Downloading the Hotswap agent

Hotwsap agent allows plugins to react to class redefinition events. These plugins are similar to the the JRebel plugins and add frameworks specific code to make sure they handle correctly to the class changes.

Download the hot swap agent jar from https://github.com/HotswapProjects/HotswapAgent/releases to an easy to type location, you will need the location to enable it.

Activate the tools

To enable HotSwap for all java launches, go to Installed JREs in Eclipse Preferences, select your active JRE and click Edit...

Eclipse Preferences.png 

Add the following text to the Default VM arguments:

-XXaltjvm=dcevm -javaagent:/replace_with_correct_path/hotswap-agent.jar

JRE settings.png

Close the windows and now all your launches will have DCEVM and Hotswap enabled,

If you prefer to enable per project basis, add the same arguments to the VM argument section of your project's Run configuration.

Known limitations

  • Change of superclass is not supported by DCEVM.