Tutorial:Update Java

(Redirected from Tutorials/Update Java)
Jump to navigation Jump to search
This feature is exclusive to Java Edition.
 

As of Minecraft Java Edition 1.21.5, the Minecraft Launcher is bundled with the Microsoft build of OpenJDK (Java SE 21). If need be, it is possible to change the used Java version in the profile options menu.

What is Java?[edit | edit source]

Java is a programming language and computing platform. Unlike many other languages, Java does not run directly on the hardware, but in a virtual machine, called the JVM (Java Virtual Machine).[1] Minecraft: Java Edition is written in Java, and uses it for game logic, rendering, and networking.

As of September 19, 2023, the long-term support (LTS) versions of Java are OpenJDK 8 (LTS, free support by Oracle ended, but still being maintained by other distributions), OpenJDK 11, OpenJDK 17 and OpenJDK 21. You should only use LTS versions of Java, as they provide important security updates.

If you use a custom JVM, you should notice that the official launcher only allow the custom JVM with the same primary Java version as the minimum required Java version to launch the game.[2]

Why update?[edit | edit source]

The latest versions of Java contain important enhancements to help improve performance, stability and security of the Java applications that run on your machine. Installing the latest Java update ensures that Minecraft continues to run safely and efficiently.

Where to download[edit | edit source]

You can get Java either from Oracle or from someone who builds OpenJDK. For the purpose of Minecraft they are essentially the same, but Oracle's "OTN" version (Oracle JDK uses "Oracle No-Fee Terms and Conditions" as of Java 17 LTS) requires a PAID license for commercial and production purposes. If you make money from streaming Minecraft or running a Minecraft server (even non-profit), you MUST use OpenJDK unless you want to figure out how to pay.

You will see that Java is divided into LTS (long-term support) like 11 and STS (short-term support) version numbers like 16. An LTS version will be given updates for longer, so people tend to use them as a stable standard of "modern, but not too new" Java.

Other VMs[edit | edit source]

Some other Java compatible VMs include:

  • IBM's Semeru (was open-sourced as Eclipse OpenJ9), IBM in-house JVM with low memory footprints and faster startup
  • Oracle's GraalVM, based on OpenJDK, similiar to Semeru, has low memory footprints and faster startup

Notes[edit | edit source]

  • The licensing change in January 2019 (8u211) is partially why Minecraft's 1.16.5 official launcher is stuck at 8u51, instead of a newer Java 8 update.
  • Java 9 to Java 16 (except Java 11) are no longer supported by Oracle: they no longer receive public security updates,[8] and are to be regarded as insecure. Oracle has removed them from its download page but the builds are still available in the Java Archive. Oracle does not recommend using builds from the Java Archive.[9]
    • Java 13, 15 is supported by source code, provides support in Azul Zulu.

How to update[edit | edit source]

When you install Java, go to your launcher, edit or create an installation, and in the Java Executable box, type C:\Program Files\Java\jvm-[version]\bin\javaw.exe (Windows) or: /usr/lib/jvm/(java version)/bin/java (Linux) or: /usr/bin/java (macOS). The exact value depends on where your java is installed.

You must remove -XX:+CMSIncrementalMode from your JVM Arguments. This option is meaningless for Java 9 and newer, and will cause a launch failure if you keep it there.

Notes[edit | edit source]

  • Because the official launcher has Java integrated, you won't need to download and install Java unless you are using third-party launchers instead.
  • If your computer runs a 64-bit operating system, it's recommended to install the 64-bit Java for better performance.
  • Administrator privileges are required when installing on some systems.

Issues[edit | edit source]

Known issues[edit | edit source]

  • In Java 11 or newer, a very rare crash may occur in world generation code (MC-149777). A fabric mod called Voyager exists to fix this issue.[7] If you are using Fabric API 0.26.2 or above, this mod is not needed as the fix is included. This bug was fixed in 1.17 snapshot 21w20a and hence does not exist from 1.17+.[10]
  • Do not upgrade if you are using Intel HD2xxx/3xxx graphics on Windows 10, as the driver is bugged. Java 8 uses a slower rendering method that makes it work, and that is mainly why Mojang stuck to this old version.[7]

Other issues[edit | edit source]

Issues relating to "Java" are maintained on the bug tracker. Issues should be reported and viewed there.

References[edit | edit source]

External links[edit | edit source]

Navigation[edit | edit source]