Version 19.2 by Markus Ruggiero on 2023/11/13 11:56

Hide last authors
Samuel Pelletier 8.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.
Samuel Pelletier 4.1 2
D Tim Cummings 14.1 3 = DCEVM and Hotswap Agent for Java 17 =
Samuel Pelletier 4.1 4
D Tim Cummings 14.1 5 === JRE patched with the DCEVM ===
6
Markus Ruggiero 18.1 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_3-b164.4, architecture osx-x64, JBR with JCEF (DCEVM), [[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.
D Tim Cummings 14.1 8
9
10 \\
11
Markus Ruggiero 18.1 12 {{{curl -OL https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk_jcef-17.0.3-osx-x64-b469.32.tar.gztar -zxf jbrsdk_jcef-17.0.3-osx-x64-b469.32.tar.gzsudo mv jbrsdk_jcef-17.0.3-x64-b469 /Library/Java/JavaVirtualMachines/}}}
D Tim Cummings 14.1 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
Markus Ruggiero 18.1 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_jcef-17.0.3-x64-b469/Contents/Home/lib/hotswapsudo mv hotswap-agent-1.4.2-SNAPSHOT.jar /Library/Java/JavaVirtualMachines/jbrsdk_jcef-17.0.3-x64-b469/Contents/Home/lib/hotswap/hotswap-agent.jar}}}
D Tim Cummings 14.1 22
23 === Install in Eclipse 2021-09 ===
24
D Tim Cummings 15.1 25 In "Help > Eclipse Marketplace" install "Java 17 Support for Eclipse 2021-09 (4.21)" (accept default packages). This should not be needed for Eclipse 2021-12.
D Tim Cummings 14.1 26
27 In "Eclipse > Preferences > Java > Installed JREs" click [Add...] (next) [MacOS X VM] (next)
28
Markus Ruggiero 18.1 29 JRE Home: /Library/Java/JavaVirtualMachines/jbrsdk_jcef-17.0.3-x64-b469/Contents/Home
D Tim Cummings 14.1 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
D Tim Cummings 15.1 37 The "~-~-add-exports" is not required for hotswap but is required to run WebObjects applications in Java 17.
D Tim Cummings 14.1 38
D Tim Cummings 15.1 39 === Troubleshooting ===
D Tim Cummings 14.1 40
D Tim Cummings 16.1 41 a. Some versions of macOS may prevent this java from running because of security quarantining. Try removing quarantine from java folder.
D Tim Cummings 15.1 42
D Tim Cummings 16.1 43
44 \\
45
Markus Ruggiero 18.1 46 {{{sudo xattr -r -d com.apple.quarantine /Library/Java/JavaVirtualMachines/jbrsdk_jcef-17.0.3-x64-b469}}}
D Tim Cummings 15.1 47
D Tim Cummings 16.1 48 b. In the "Project" menu, "Build Automatically" should be selected for hot swap to work.
49
D Tim Cummings 14.1 50 = DCEVM and Hotswap Agent for Java 8 =
51
52 === Prerequisites ===
53
Samuel Pelletier 8.1 54 * A JRE patched with the DCEVM
Samuel Pelletier 4.1 55 * (% style="line-height: 1.4285715;" %)The Hotwsap agent to handle the WebObjects caches.
56
57 === (% style="line-height: 1.4285715;" %)Patching the VM(%%) ===
58
Theodore Petrosky 12.1 59 (% 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.
Samuel Pelletier 4.1 60
Theodore Petrosky 12.1 61 DCEVM download site: **[[http:~~/~~/dcevm.github.io>>url:http://dcevm.github.io||shape="rect"]]**
Samuel Pelletier 4.1 62
Theodore Petrosky 12.1 63 **Launch the installer as root**
64
Theodore Petrosky 13.1 65 (% style="font-family: Arial , sans-serif;" %)sudo java -jar DCEVM-light-8u92-installer.jar
Theodore Petrosky 12.1 66
Theodore Petrosky 13.1 67 {{{}}}
Theodore Petrosky 12.1 68
Theodore Petrosky 13.1 69 (As of November 1, 2018 DCEVM-8u181-installer.jar is available)
Theodore Petrosky 12.1 70
71 Click "Add installation directory..." and select your JRE Home.
72
73 [[image:attach:DCEVM installer.png]]
74
75 Click "Install DCEVM ad altvm"
76
77 Quit the installer by closing the window.
78
Samuel Pelletier 8.1 79 === (% style="line-height: 1.4285715;" %)Downloading the Hotswap agent(%%) ===
Samuel Pelletier 4.1 80
Samuel Pelletier 8.1 81 (% 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.
Samuel Pelletier 4.1 82
Theodore Petrosky 12.1 83 (% 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.
Samuel Pelletier 4.1 84
Theodore Petrosky 12.1 85 === Activate the tools ===
Samuel Pelletier 4.1 86
Theodore Petrosky 12.1 87 To enable HotSwap for all java launches, go to Installed JREs in Eclipse Preferences, select your active JRE and click Edit...
Samuel Pelletier 4.1 88
Theodore Petrosky 12.1 89 [[image:attach:Eclipse Preferences.png]]
90
D Tim Cummings 14.1 91 \\
Theodore Petrosky 12.1 92
93 Add the following text to the Default VM arguments:
94
Samuel Pelletier 8.1 95 -XXaltjvm=dcevm -javaagent:/replace_with_correct_path/hotswap-agent.jar
Samuel Pelletier 4.1 96
Theodore Petrosky 12.1 97 [[image:attach:JRE settings.png]]
98
99 Close the windows and now all your launches will have DCEVM and Hotswap enabled,
100
101 If you prefer to enable per project basis, add the same arguments to the VM argument section of your project's Run configuration.
102
Samuel Pelletier 8.1 103 === Known limitations ===
Samuel Pelletier 4.1 104
Samuel Pelletier 8.1 105 * Change of superclass is not supported by DCEVM.
106
Samuel Pelletier 4.1 107 (% style="line-height: 1.4285715;" %)