Changes for page Using DCEVM and Hotswap for rapid turnaround
Last modified by Samuel Pelletier on 2025/12/03 16:46
From version 6.1
edited by Samuel Pelletier
on 2015/07/07 15:15
on 2015/07/07 15:15
Change comment:
There is no comment for this version
To version 19.3
edited by Samuel Pelletier
on 2025/12/03 16:46
on 2025/12/03 16:46
Change comment:
There is no comment for this version
Summary
-
Page properties (2 modified, 0 added, 0 removed)
-
Attachments (0 modified, 7 added, 0 removed)
Details
- Page properties
-
- Parent
-
... ... @@ -1,0 +1,1 @@ 1 +WOL.Home.WOLips.WebHome - Content
-
... ... @@ -1,27 +1,106 @@ 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. 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 -* A JRE patched with the DCEVM [[http:~~/~~/dcevm.github.io>>url:http://dcevm.github.io||style="line-height: 1.4285715;" shape="rect"]](% style="line-height: 1.4285715;" %) 6 -* (% style="line-height: 1.4285715;" %)The Hotwsap agent to handle the WebObjects caches. 5 +=== JRE patched with the DCEVM === 7 7 8 - ===(% style="line-height:1.4285715;"%)Patchingthe VM(%%)===7 +The Jetbrains JDK releases are unofficial but they provide JREs patched with the DCEVM. They are available here (select a "with JCEF" version) 9 9 10 - (% style="line-height: 1.4285715;" %)DCEVM isthepatch that enable the enhanced class redefinition in the VM.Download theinstallerfor your JRE versionandinstall thealternative VM. The patch isnot alwaysavailable for the latest update of the JRE, youmay try the latest update available but it maynotworks. At the timeI write this,the patch for Java 1.8 update 45 isat build 15 and it does not works completely, Iget exceptionbecause someDelegatingClassLoader are notupdated. The versionfor Java 1.7update 71 build 2 works finewith java 1.7.0_79.9 +[[https:~~/~~/github.com/JetBrains/JetBrainsRuntime>>https://github.com/JetBrains/JetBrainsRuntime]] 11 11 12 - ===(%style="line-height:1.4285715;" %)Hotswapagent(%%) ===11 +I recommend installer (.pkg) versions for easy installation. 13 13 14 - (%style="line-height:1.4285715;"%)Hotwsapagent isanagent (likeJRebel)thatallows pluginstoreactto classredefinitionevents.These pluginsare similarto the the JRebelplugins andadd frameworks specific codetomake sure theyreact correctly to the classchanges.13 +If you prefer the manual way, download archived version (.tar.gz) and move it's contents in the system JRE directory /Library/Java/JavaVirtualMachines/ 15 15 16 - (%style="line-height:1.4285715;" %)15 +=== Hotswap Agent === 17 17 17 +Download and install Hotswap agent from the official site [[https:~~/~~/github.com/HotswapProjects/HotswapAgent>>https://github.com/HotswapProjects/HotswapAgent]] 18 18 19 - =(%style="line-height:1.4285715;"%)How touse(%%) =19 +The easiest way is to add it directly into the JRE in the Home/lib/hotswap directory. 20 20 21 - (%style="line-height:1.4285715;" %)21 +Here are the detailed steps with an installed JDK in /Library/Java/JavaVirtualMachines/jbr_jcef-21.0.8-osx-aarch64-b1163.69/ and the latest hotswap release at [[https:~~/~~/github.com/HotswapProjects/HotswapAgent/releases/download/RELEASE-2.0.1/hotswap-agent-2.0.1.jar>>https://github.com/HotswapProjects/HotswapAgent/releases/download/RELEASE-2.0.1/hotswap-agent-2.0.1.jar]] 22 22 23 +{{{sudo mkdir /Library/Java/JavaVirtualMachines/jbr_jcef-21.0.8-osx-aarch64-b1163.69/Contents/Home/lib/hotswap 24 +sudo curl -Lo "/Library/Java/JavaVirtualMachines/jbr_jcef-21.0.8-osx-aarch64-b1163.69/Contents/Home/lib/hotswap/hotswap-agent.jar" ""}}} 23 23 24 - (%style="line-height:1.4285715;"%)26 +After installing your preferred releases (select a "with JCEF" version) you need to add it to your Eclipse workspace and select it as default. You need to add these Default VM Arguments to enable HotSwap "-XX:+AllowEnhancedClassRedefinition -XX:HotswapAgent=fatjar" 25 25 28 +=== Install in Eclipse 2025-09 === 26 26 27 -(% style="line-height: 1.4285715;" %) 30 +In "Eclipse > Settings > Java > Installed JREs" click [Add...] (next) [MacOS X VM] (next) 31 + 32 + JRE Home: /Library/Java/JavaVirtualMachines/jbr_jcef-21.0.8-osx-aarch64-b1163.69/Contents/Home 33 + 34 + JRE name: jbr_jcef-21.0.8-osx-aarch64-b1163.69 //or anything you prefer// 35 + 36 + Default VM arguments: "-XX:+AllowEnhancedClassRedefinition -XX:HotswapAgent=fatjar" 37 + 38 + [Finish] 39 + 40 +The "~-~-add-exports" is not required for hotswap but is required to run WebObjects applications in Java 17. 41 + 42 +=== Troubleshooting === 43 + 44 +a. Some versions of macOS may prevent this java from running because of security quarantining. Try removing quarantine from java folder. 45 + 46 +{{{sudo xattr -r -d com.apple.quarantine /Library/Java/JavaVirtualMachines/jbrsdk_jcef-17.0.3-x64-b469}}} 47 + 48 +b. In the "Project" menu, "Build Automatically" should be selected for hot swap to work. 49 + 50 += DCEVM and Hotswap Agent for Java 8 = 51 + 52 +=== Prerequisites === 53 + 54 +* A JRE patched with the DCEVM 55 +* The Hotwsap agent to handle the WebObjects caches. 56 + 57 +=== Patching the VM === 58 + 59 +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. 60 + 61 +DCEVM download site: **[[http:~~/~~/dcevm.github.io>>url:http://dcevm.github.io]]** 62 + 63 +**Launch the installer as root** 64 + 65 +sudo java -jar DCEVM-light-8u92-installer.jar 66 + 67 +{{{ 68 + }}} 69 + 70 +(As of November 1, 2018 DCEVM-8u181-installer.jar is available) 71 + 72 +Click "Add installation directory..." and select your JRE Home. 73 + 74 +[[image:DCEVM%20installer.png||alt="DCEVM installer.png"]] 75 + 76 +Click "Install DCEVM ad altvm" 77 + 78 +Quit the installer by closing the window. 79 + 80 +=== Downloading the Hotswap agent === 81 + 82 +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. 83 + 84 +Download the hot swap agent jar from [[https:~~/~~/github.com/HotswapProjects/HotswapAgent/releases>>url:https://github.com/HotswapProjects/HotswapAgent/releases]] to an easy to type location, you will need the location to enable it. 85 + 86 +=== Activate the tools === 87 + 88 +To enable HotSwap for all java launches, go to Installed JREs in Eclipse Preferences, select your active JRE and click Edit... 89 + 90 +[[image:Eclipse%20Preferences.png||alt="Eclipse Preferences.png"]] 91 + 92 +Add the following text to the Default VM arguments: 93 + 94 +-XXaltjvm=dcevm -javaagent:/replace_with_correct_path/hotswap-agent.jar 95 + 96 +[[image:JRE%20settings.png||alt="JRE settings.png"]] 97 + 98 +Close the windows and now all your launches will have DCEVM and Hotswap enabled, 99 + 100 +If you prefer to enable per project basis, add the same arguments to the VM argument section of your project's Run configuration. 101 + 102 +=== Known limitations === 103 + 104 +* Change of superclass is not supported by DCEVM. 105 + 106 +
- DCEVM installer.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.XWikiGuest - Size
-
... ... @@ -1,0 +1,1 @@ 1 +399.3 KB - Content
- DCEVM%20installer.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.Sam - Size
-
... ... @@ -1,0 +1,1 @@ 1 +399.3 KB - Content
- Eclipse Preferences.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.XWikiGuest - Size
-
... ... @@ -1,0 +1,1 @@ 1 +163.2 KB - Content
- Eclipse%20Preferences.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.Sam - Size
-
... ... @@ -1,0 +1,1 @@ 1 +163.2 KB - Content
- JRE settings.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.XWikiGuest - Size
-
... ... @@ -1,0 +1,1 @@ 1 +393.2 KB - Content
- JRE%20settings.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.Sam - Size
-
... ... @@ -1,0 +1,1 @@ 1 +393.2 KB - Content
- Screen Shot 2021-11-12 at 07.44.51.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.XWikiGuest - Size
-
... ... @@ -1,0 +1,1 @@ 1 +196.2 KB - Content