This guide will help you change your default Java installation in case you want to use a specific version of Java. Minecraft and Forge were built using Java 8, so you may experience issues using later versions of Java.

Where do I get Java 8?

There are several places where you can get Java 8 or an OpenJDK fork of Java 8. I (Jonathing) recommend Amazon Corretto, as it is constantly updated with new bugfixes and is maintained by Amazon AWS and is one of the most common OpenJDKs out there. If you want to use vanilla Java by Oracle, you will need to make an Oracle account to be able to download it. Here is a list of Java JDKs/JREs including Oracle’s Java and some common OpenJDK distributions.

Step 1 – Find your Java installation path

Should be in a similar path to this one. “C:\Program Files\Java\jre1.8.0_271\bin” double check your own path. Then where it says, “This PC > Local Disk C:/” at the top, click there and copy the path. “CTRL + C”

Step 2 – Find Environment Variables

Press windows key and search, “system environment variables”, click “Environment Variables…”

Step 3 – Edit Variables

In the “System variables” section, find something that says, “Path” click on it and then click “Edit…”

Step 4 – Add New Variable

Click “New” and then paste the path you copied. Make sure to click “Move Up” to move it above any existing java paths.

Step 5 – Enjoy!

Just click “OK” until all the boxes are closed, and then open your CMD and type java -version to verify you’re using Java 8