Tutorials/Update Java

From Minecraft Wiki
Jump to: navigation, search

Updating Java is important to do as a Minecraft player, as some technical bugs may be fixed only by updating Java.

The Minecraft launcher is bundled with Java version 1.8.0_51, which is used by default. It is possible to change the used Java version in the profile options menu.

What is Java?[edit]

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 is written in Java, and uses it for game logic, rendering, and networking.

As of February 4, 2021, the latest stable (Long-Term Support) Java versions are 1.8.0_281 and 11.0.10, while the latest development build is version 16 early-access build 34 and 17 early-access build 17.

Why update?[edit]

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.

  • As of the Java Edition 1.12 update, Minecraft requires Java 8 or newer.[2]
  • Minecraft may sometimes crash without being run by a relatively modern version of Java.
  • Java updates fix lots of problems and bugs and typically cause increases in performance.
    • For example, the newer garbage collectors can help with lag spikes during high memory usage.[3]
  • Running a server requires your computer to have Java installed instead of the pre-installed Java. See Tutorials/Setting up a server for more information.

Where to download[edit]

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 requires a PAID license for commercial and production purposes. If you make money from streaming minecraft or run a minecraft (even non-profit) server, 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 12. A 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]

With sources like AdoptOpenJDK you might see a choice between HotSpot VM and something else. The VM is what actually executes the Java code, and HotSpot is the one written by Oracle and used in "official" releases. Some other VMs include:

  • IBM's OpenJ9, optimized for low memory and fast startup
  • Oracle's GraalVM, also optimized for low memory and fast startup; basically HotSpot on steroids

GraalVM is usually included in HotSpot in the form of "JVMCI".[4] OpenJ9 takes a separate download.

Notes[edit]

  • The licensing change in January 2019 (8u211) is partially why Minecraft's official launcher is stuck at 8u51, instead of a newer Java 8 update.
  • Java 9, 10 and 12 are no longer supported by Oracle: they no longer receive public security updates,[5] 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.[6]

How to update[edit]

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). 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]

  • Because of the official launcher have Java integrated, so you needn't download and install the Java unless you are using third-party launcher instead.
  • If your computer runs a 64-bit operating system, it's recommended to install the 64-bit Java for better peformance.
  • Administrator previleges is required when installing on some systems.

Known issues[edit]

  • 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.[3] If you are using fabric API 0.26.2 or above, this mod is not needed as the fix is included.[7]
  • 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.[3] Funnily enough, the current minimum GPU requirement for Minecraft appears to be Intel HD4xxx graphics, which would make this fix from Mojang seem obsolete as Java 8u211 could potentially offer more stability if they implemented it.

References[edit]

External links[edit]