Wiki source code of Using DCEVM and Hotswap for rapid turnaround
Version 4.1 by Samuel Pelletier on 2016/06/12 17:17
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | 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. | ||
2 | |||
3 | = Prerequisites = | ||
4 | |||
5 | * A JRE patched with the DCEVM | ||
6 | * (% style="line-height: 1.4285715;" %)The Hotwsap agent to handle the WebObjects caches. | ||
7 | |||
8 | === (% style="line-height: 1.4285715;" %)Patching the VM(%%) === | ||
9 | |||
10 | (% style="line-height: 1.4285715;" %)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. | ||
11 | |||
12 | DCEVM download site: **[[http:~~/~~/dcevm.github.io>>url:http://dcevm.github.io||shape="rect"]]** | ||
13 | |||
14 | **Launch the installer as root** | ||
15 | |||
16 | ** | ||
17 | ** | ||
18 | |||
19 | {{{sudo java -jar DCEVM-light-8u92-installer.jar}}} | ||
20 | |||
21 | Click "Add installation directory..." and select your JRE Home. | ||
22 | |||
23 | [[image:attach:DCEVM installer.png]] | ||
24 | |||
25 | Click "Install DCEVM ad altvm" | ||
26 | |||
27 | Quit the installer by closing the window. | ||
28 | |||
29 | === (% style="line-height: 1.4285715;" %)Downloading the Hotswap agent(%%) === | ||
30 | |||
31 | (% style="line-height: 1.4285715;" %)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. | ||
32 | |||
33 | (% style="line-height: 1.4285715;" %)Download the hot swap agent jar from [[https:~~/~~/github.com/HotswapProjects/HotswapAgent/releases>>url:https://github.com/HotswapProjects/HotswapAgent/releases||shape="rect"]] to an easy to type location, you will need the location to enable it. | ||
34 | |||
35 | === Activate the tools === | ||
36 | |||
37 | To enable HotSwap for all java launches, go to Installed JREs in Eclipse Preferences, select your active JRE and click Edit... | ||
38 | |||
39 | [[image:attach:Eclipse Preferences.png]] | ||
40 | |||
41 | Add the following text to the Default VM arguments: | ||
42 | |||
43 | -XXaltjvm=dcevm -javaagent:/replace_with_correct_path/hotswap-agent.jar | ||
44 | |||
45 | [[image:attach:JRE settings.png]] | ||
46 | |||
47 | Close the windows and now all your launches will have DCEVM and Hotswap enabled, | ||
48 | |||
49 | If you prefer to enable per project basis, add the same arguments to the VM argument section of your project's Run configuration. | ||
50 | |||
51 | === Known limitations === | ||
52 | |||
53 | * Change of superclass is not supported by DCEVM. | ||
54 | |||
55 | (% style="line-height: 1.4285715;" %) |