Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.15.2-31.1.0] Intellij and Gradlew Forge Hotswap and DCEVM Tutorial


Recommended Posts

This is a small guide for people how want to Speed up their development by swapping changed code during run time, which eliminates the need to constantly restart the Minecraft-Client.

 

To reach our goal we need to install Hotswap and DCEVM.

 

To install DCEVM you first need to download the newest release for java 8 form this link:

https://github.com/dcevm/dcevm/releases

 

Before you continue installing DCEVM you need to first install the right java version that matches your download. Most likely this will be the version 1.8.0_181.

The download list can be found here:

https://www.oracle.com/java/technologies/javase/javase8-archive-downloads.html

 

To now install DCEVM run java -jar "path_to_the_installer/DCEVM-8u181-installer.jar" as Administrator in your console.

 

In the UI that pops up you need to select the java version you just installed and click on Install DCEVM as altjvm. You probably need to do this for the jdk and jre.

 

Next download the hotswap-agent and place the jar file in an appropriate folder.

https://github.com/HotswapProjects/HotswapAgent/releases

 

 

Now the Basic setup is finished, our next step is too setup Intellij and gradle two run correctly.

 

First thing you need to do is to install the HotswapAgent plugin for Intellij.

Plugins can be install under: Settings -> Plugins -> Marketplace

Search for hotswapagent.

 

Now under Tools -> HotswapAgent select Enable HotswapAgent in all configurations

 

Under Keymap search for "Reload Changed Classes" and assign a Keyboard shortcut.

 

Now press double shift and search for "Registry..."

and enable compiler.automake.allow.when.app.running

 

Finally to run the Minecraft client create a new gradle configuration 

with task = "runClient"

and VM options = "-Xmx3G
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5010
-XXaltjvm=dcevm
-XX:+UnlockExperimentalVMOptions
-javaagent:path_to_your\hotswap-agent-1.4.0.jar"

 

Now your good to go.

If you have any questions or suggestions feel free to comment below this is my first tutorial so 

if you have any advise it would be more than welocome.

I hope this is helpful for you have a nice Day.

 

 

  • Thanks 2
Link to comment
Share on other sites

  • 4 weeks later...

Thanks for the how-to. Took a while to get it working even when reading this. I don't know if I would have had the patience to figure it out without it. XD Just a few notes.

 

1. You need to press 'Ok' on Intellij to apply changes to plugins. I definitely didn't spend 20 minutes trying to figure this out.

2. The vm option doesn't seem to be needed. The hot swap plugin didn't seem needed either. Was able to hotswap without both, but DCEVM needs to be installed.

3. Under Build the 'Build Project' and 'Recompile' option (and their shortcuts) works just fine, so no need to remap keys.

4. Everything other than installing DCEVM is unnecessary.

Link to comment
Share on other sites

Hey TheZombie1999, thanks for the guide but I'm really new to modding and I've just setup my development environment yesterday for the first time and I really need to be able to hotswap, it's really slowing me down to restart minecraft over and over again..

 

But I couldn't work this out, then I saw ZDoctor's comment then start over from scratch, removed everything I've installed and just installed DCVEM for java jdk 1.8.0_181 and jre 1.8.0_181. It is now installed but what's next? I should have to do something in order hotswap to work right? Something is missing and I don't know what to do. Even if It's correct I don't know how to hotswap either, I mean when I run the client if I make any changes how can I hotswap? Nothing happens when I click rebuild.

 

Sorry if this is a very dumb question but as I've said I'm pretty new to these things.

 

I've attached my runClient config.

 

Screenshot_14.png

Link to comment
Share on other sites

  • 1 month later...
On 4/22/2020 at 12:55 PM, RepubliCity said:

Hey TheZombie1999, thanks for the guide but I'm really new to modding and I've just setup my development environment yesterday for the first time and I really need to be able to hotswap, it's really slowing me down to restart minecraft over and over again..

 

But I couldn't work this out, then I saw ZDoctor's comment then start over from scratch, removed everything I've installed and just installed DCVEM for java jdk 1.8.0_181 and jre 1.8.0_181. It is now installed but what's next? I should have to do something in order hotswap to work right? Something is missing and I don't know what to do. Even if It's correct I don't know how to hotswap either, I mean when I run the client if I make any changes how can I hotswap? Nothing happens when I click rebuild.

 

Sorry if this is a very dumb question but as I've said I'm pretty new to these things.

 

I've attached my runClient config.

 

Screenshot_14.png

 

same nothing happened :(

Link to comment
Share on other sites

  • 2 weeks later...

Hi, I'm current dcevm8/11 maintainer and my son is keen Minecraft player. Is the java8 edition still relevant for Minecraft developers? I can port G1 garbage collector with some hotswap performance optimizations from java11(dcevm11) to java8(dcevm8), if the community is interested in.

 

Btw, current dcevm11 is at https://github.com/TravaOpenJDK/trava-jdk-11-dcevm , optimized with another new features at https://github.com/TravaOpenJDK/trava-jdk-11-dcevm-staged

Link to comment
Share on other sites

  • 4 weeks later...
On 6/26/2020 at 4:07 PM, skybber said:

Hi, I'm current dcevm8/11 maintainer and my son is keen Minecraft player. Is the java8 edition still relevant for Minecraft developers? I can port G1 garbage collector with some hotswap performance optimizations from java11(dcevm11) to java8(dcevm8), if the community is interested in.

 

Btw, current dcevm11 is at https://github.com/TravaOpenJDK/trava-jdk-11-dcevm , optimized with another new features at https://github.com/TravaOpenJDK/trava-jdk-11-dcevm-staged

It's definitely still relevant for Minecraft mod development. I don't think Minecraft Forge officially supports anything newer than Java 8 yet.

Edited by EmberQuill
Link to comment
Share on other sites

  • 2 months later...
On 4/22/2020 at 6:55 AM, RepubliCity said:

I mean when I run the client if I make any changes how can I hotswap? Nothing happens when I click rebuild.

Same thing for me... I've tried with both the hotswap plugin and without, and no changes occur. I've verified everything is setup correctly. Also not sure of the difference between "Recompile" under Build, and "Reload Changed Classes" under debug actions (I assume it makes no difference in debug mode?). Or if only certain changes are detected during runtime. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.