Change Default Java Installation (Windows 10)
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.
- Oracle Java SE 8 (Oracle Account Required)
- Amazon Corretto 8
- BellSoft Liberica JDK 8
- AdoptOpenJDK 8 (Hotspot or OpenJ9)
- Azul Zulu Community 8
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”
Press windows key and search, “system environment variables”, click “Environment Variables…”
In the “System variables” section, find something that says, “Path” click on it and then click “Edit…”
Click “New” and then paste the path you copied. Make sure to click “Move Up” to move it above any existing java paths.
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