Updating Java using AdoptOpenJDK and Twitch - 04Slash/Updating-Java-AdoptOpenJDK GitHub Wiki

A guide to downloading and installing AdoptOpenJDK and getting Twitch to use that new version of java.


First we must get the proper version of AdoptOpenJDK. Visit the AdoptOpenJDK website and ensure that ‘OpenJDK 8 (LTS)’ (1) and ‘HotSpot’ (1) are selected. Select your operating system (2) and the make sure the architecture is set to x64 (2). From here you will want the JRE, NOT the JDK (3). The JDK version will not work with twitch since the java argument that will be used will not detect the JDK version, only the JRE version. You do not need the JDK version if you are just a user; The JDK is for development.


After downloading the JRE version, run the file and click Next, Accept the terms then Next. Click the red X beside ‘JavaSoft (Oracle) registry keys’ and set it to ‘Entire Feature will be installed on local hard drive’. From here go through the rest of the installation process. I also set the ‘Set JAVA_HOME variable’ to the same value. I don’t think this is required but if you experience any issues then try setting this to ‘Entire Feature’ as well.


Open the Twitch app and go into the settings. You can do so by clicking your profile picture, Settings, then clicking the Minecraft tab. Scroll to the bottom of the Minecraft tab. If you are on windows then make sure that the Native Launcher is selected. For Macs you will have to use the Jar launcher (in this case, just specify the Java Version). Add -version:1.8+ into the ‘Additional Arguments’ section. That’s it! You should now be able to launch minecraft through twitch and it should use the version of java you just downloaded.


I recommend using more additional arguments to help tune the GC which may help reduce microstutters and long pauses after long periods of play. I stick with the ones that cpw has mentioned in this post. He goes over what each one does if you’re interested. I will paste them here for reference and to add the above version argument into it.

-XX:+UseG1GC -Dsun.rmi.dgc.server.gcInterval=2147483646 -XX:+UnlockExperimentalVMOptions -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M -version:1.8+

cpw also recommends setting -Xms to the same value as your allocated ram. If you’ve allocated 8GB of ram you would set this to -Xms8G, which should look like this:

-XX:+UseG1GC -Dsun.rmi.dgc.server.gcInterval=2147483646 -XX:+UnlockExperimentalVMOptions -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M -version:1.8+ -Xms8G

If you do not allocate 8GB of ram do not use -Xms8G! Change the 8 in 8G to the amount of ram you allocate.

⚠️ **GitHub.com Fallback** ⚠️