Changes for page Using DCEVM and Hotswap for rapid turnaround
Last modified by Markus Ruggiero on 2022/07/28 14:18
From version 11.1
edited by Samuel Pelletier
on 2015/07/07 17:42
on 2015/07/07 17:42
Change comment:
There is no comment for this version
To version 14.1
edited by D Tim Cummings
on 2021/11/11 22:49
on 2021/11/11 22:49
Change comment:
There is no comment for this version
Summary
-
Page properties (2 modified, 0 added, 0 removed)
Details
- Page properties
-
- Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. Sam1 +XWiki.timcu - Content
-
... ... @@ -1,34 +1,98 @@ 1 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 2 3 -= Prerequisites =3 += DCEVM and Hotswap Agent for Java 17 = 4 4 5 +=== JRE patched with the DCEVM === 6 + 7 +The Jetbrains JDK releases are unofficial but they provide JREs patched with the DCEVM. They are available at [[https:~~/~~/github.com/JetBrains/JetBrainsRuntime/releases>>url:https://github.com/JetBrains/JetBrainsRuntime/releases||shape="rect"]] . These instructions were tested with Release 17_0_1-b164.4, architecture osx-x64, JBR with JCEF (DCEVM) , [[jbr>>url:https://cache-redirector.jetbrains.com/intellij-jbr/jbr_dcevm-17_0_1-osx-x64-b164.4.tar.gz||shape="rect"]] and [[jbrsdk>>url:https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk_dcevm-17_0_1-osx-x64-b164.4.tar.gz||shape="rect"]]. They should also work with architecture osx-aarch64. 8 + 9 + 10 +\\ 11 + 12 +{{{curl -OL curl -O https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk_dcevm-17_0_1-osx-x64-b164.4.tar.gztar -zxf jbrsdk_dcevm-17_0_1-osx-x64-b164.4.tar.gzsudo mv jbrsdk /Library/Java/JavaVirtualMachines/jbrsdk_dcevm-17_0_1-osx-x64-b164.4}}} 13 + 14 +=== Hotswap Agent === 15 + 16 +Copy the latest version of Hotswap Agent from [[https:~~/~~/github.com/HotswapProjects/HotswapAgent/releases>>url:https://github.com/HotswapProjects/HotswapAgent/releases||shape="rect"]] 17 + 18 + 19 +\\ 20 + 21 +{{{curl -OL https://github.com/HotswapProjects/HotswapAgent/releases/download/1.4.2-SNAPSHOT/hotswap-agent-1.4.2-SNAPSHOT.jarsudo mkdir /Library/Java/JavaVirtualMachines/jbrsdk_dcevm-17_0_1-osx-x64-b164.4/Contents/Home/lib/hotswapsudo mv hotswap-agent-1.4.2-SNAPSHOT.jar /Library/Java/JavaVirtualMachines/jbrsdk_dcevm-17_0_1-osx-x64-b164.4/Contents/Home/lib/hotswap/hotswap-agent.jar}}} 22 + 23 +=== Install in Eclipse 2021-09 === 24 + 25 +In "Help > Eclipse Marketplace" install "Java 17 Support for Eclipse 2021-09 (4.21)" (Don't need patch sources). This should not be needed for Eclipse 2021-12. 26 + 27 +In "Eclipse > Preferences > Java > Installed JREs" click [Add...] (next) [MacOS X VM] (next) 28 + 29 + JRE Home: /Library/Java/JavaVirtualMachines/jbrsdk_dcevm-17_0_1-osx-x64-b164.4/Contents/Home 30 + 31 + JRE name: jetbrains dcevm 17 32 + 33 + Default VM arguments: -XX:HotswapAgent=fatjar ~-~-add-exports=java.base/sun.security.action=ALL-UNNAMED 34 + 35 + [Finish] 36 + 37 +\\ 38 + 39 +{{{}}} 40 + 41 += DCEVM and Hotswap Agent for Java 8 = 42 + 43 +=== Prerequisites === 44 + 5 5 * A JRE patched with the DCEVM 6 6 * (% style="line-height: 1.4285715;" %)The Hotwsap agent to handle the WebObjects caches. 7 7 8 8 === (% style="line-height: 1.4285715;" %)Patching the VM(%%) === 9 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 45is at build 15 and it does notworkscompletely,I get exception because some DelegatingClassLoader are not updated.The version for Java 1.7 update 71 build 2 works fine with java 1.7.0_79.50 +(% 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 11 12 -DCEVM download site: **[[http:~~/~~/dcevm.github.io>>url:http://dcevm.github.io||shape="rect"]] 52 +DCEVM download site: **[[http:~~/~~/dcevm.github.io>>url:http://dcevm.github.io||shape="rect"]]** 13 13 54 +**Launch the installer as root** 55 + 56 +(% style="font-family: Arial , sans-serif;" %)sudo java -jar DCEVM-light-8u92-installer.jar 57 + 58 +{{{}}} 59 + 60 +(As of November 1, 2018 DCEVM-8u181-installer.jar is available) 61 + 62 +Click "Add installation directory..." and select your JRE Home. 63 + 64 +[[image:attach:DCEVM installer.png]] 65 + 66 +Click "Install DCEVM ad altvm" 67 + 68 +Quit the installer by closing the window. 69 + 14 14 === (% style="line-height: 1.4285715;" %)Downloading the Hotswap agent(%%) === 15 15 16 16 (% 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. 17 17 18 -(% style="line-height: 1.4285715;" %)Download the hot swap agent jar from my fork at[[https:~~/~~/github.com/spelletier/HotswapAgent/releases/tag/0.2_with_WO>>url:https://github.com/spelletier/HotswapAgent/releases/tag/0.2_with_WO||shape="rect"]] to an easy to type location, you will need the location to enable it.74 +(% 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. 19 19 20 -=== Howto useinaproject ===76 +=== Activate the tools === 21 21 22 -To enable HotSwap ,add thefollowing to the Run configurationofyourprojectn theVMargumentsection:78 +To enable HotSwap for all java launches, go to Installed JREs in Eclipse Preferences, select your active JRE and click Edit... 23 23 80 +[[image:attach:Eclipse Preferences.png]] 81 + 82 +\\ 83 + 84 +Add the following text to the Default VM arguments: 85 + 24 24 -XXaltjvm=dcevm -javaagent:/replace_with_correct_path/hotswap-agent.jar 25 25 26 - === Known limitations===88 +[[image:attach:JRE settings.png]] 27 27 28 -* Change of superclass is not supported by DCEVM. 29 -* Modifying the return type of a method breaks. It seems there is some cache not cleared. 90 +Close the windows and now all your launches will have DCEVM and Hotswap enabled, 30 30 31 - (%style="line-height:1.4285715;"%)92 +If you prefer to enable per project basis, add the same arguments to the VM argument section of your project's Run configuration. 32 32 94 +=== Known limitations === 33 33 96 +* Change of superclass is not supported by DCEVM. 97 + 34 34 (% style="line-height: 1.4285715;" %)