Updating to Java 16

As of Minecraft 1.17, Paper will only support Java 16 and above. This is in line with our new policy of only supporting the last two long-term-support (LTS) versions of the Java runtime. Although Minecraft 1.17 requires a Java version that is too new for any LTS, we will maintain our policy as far as possible. We will only support Java 16 and above because of Mojang Studios deciding to bump their own Java requirement with 1.17.

If you’re a developer or want to be on the safe side, pick the JDK options in the guides instead of a generic JRE. The JDK contains the JRE, in addition to development material (sources, documentation, a reference compiler, and more).

To update, please find the appropriate header for you in the table of contents.

Shared hosts

If you cannot find your host in the following list, you should open a support ticket with your host’s website to ask how to update.

Apex Hosting

Apex Hosting is already on Java 16 for both Paper and Waterfall. You don’t need to do anything to update.

Aternos

If you run Paper, you should have Java 16 selected automatically. If you run Minecraft 1.16 or earlier, you can change this in the server configuration panel on their website to Java 8, 11, or 16:

../_images/aternos-environment.png

Bloom.Host

You can select Java 16 from the server configuration panel by selecting the Java version option ending in openjdk-16:

../_images/bloomhost-java-version.jpg

Creeper.Host

CreeperHost has some terrific documentation on how to do this on their website: Changing Java Version.

DedicatedMC

When loading Minecraft 1.17, the server will automatically be set to Java 16, and you don’t need to do anything whatsoever. If you wish to test Java 16 before updating, you can set this yourself in the Startup Settings panel:

../_images/dedicatedmc-java-version.png

For more information, feel free to read the How to change your server’s Java version guide on their wiki.

MCProHosting

When loading 1.17, the server will automatically be set to Java 16 and you don’t have to do anything whatsoever. If you want to test Java 16 on Minecraft 1.16 or earlier, you will need to set the server type to Snapshot, then put Paper back on the server manually.

PebbleHost

PebbleHost’s knowledgebase has a great article Does PebbleHost support Java 16? on their website to show how to change the Java version, along with incompatibilities with certain versions.

WinterNode

WinterNode’s Help Center has an helpful article Java Version Selector showing how to change the Java version, along with recommendations per Minecraft version. If you do nothing, it will automatically select the version that fits best for your server.

Pterodactyl

Note

To switch the Java version on Pterodactyl, you will require an administrator account.

Note

The names of options will be different depending on the language you use.

Assuming you are already logged in on your administrator account, open the administrator control panel, go to the Servers tab, click on your server (this has to be repeated for every server you wish to switch the Java version of), and press the Startup tab.

Proceed by replacing the text in the Image input field under Docker Container Configuration with the following: quay.io/parkervcp/pterodactyl-images:debian_openjdk-16. You can also replace 16 with 11 for Java 11.

../_images/pterodactyl-startup-tab.png

Debian/Ubuntu

To install Java 16 on Debian, Ubuntu, and the plethora of other distributions based on these, execute the following commands to add the AdoptOpenJDK APT repository and to install AdoptOpenJDK Hotspot:

$ sudo apt update
$ sudo apt install apt-transport-https software-properties-common gnupg wget
$ wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | sudo apt-key add -
$ sudo add-apt-repository https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/
$ sudo apt update
$ sudo apt install adoptopenjdk-16-hotspot

You can also replace 16 with 11 for Java 11.

Arch Linux

Note

There is no JRE-only Java 16 package for Arch Linux. This is not an issue whatsoever, but if you’d like the smaller variant, you can use the Linux (Generic) guide instead.

To install Java 16 on Arch Linux, you will need to use the Arch User Repository (AUR). You need to install the jdk-adoptopenjdk package.

To simplify this process, and to make updating easier, see yay.

To switch between available Java versions on the system, see the wiki on Switching between JVMs.

Linux (Generic)

Note

You should check with your distribution’s package manager(s) before using this section of the guide. It is very likely you can find a suitable Java version if you search its repositories for java, openjdk, and jre.

SDKMAN!

Install SDKs with ease! Wa-pow! Luckily SDKMAN! is written in bash, so you can use this on practically any Linux (and BSD!) environment. Follow the installation instructions on their website.

You can then proceed to install one of their many Java distributions with the simple commands on their website.

AdoptOpenJDK

Note

This assumes an intermediate to advanced Linux user. Ask for help if you need it; we don’t want you to harm your system. #paper-help on Discord is a fitting channel for asking, and remember: don’t ask to ask, just ask.

Note

You are going to require the tar and sha256sum tools to do this install.

First, select an appropriate tar.gz file from AdoptOpenJDK’s website, and copy the download URL.

Next, figure out which directory you want to install Java to; this is commonly a subdirectory within /usr/lib/jvm. The tar file you copied the URL to has an inner directory, so you don’t need to create one yourself.

Download the file with one of the following commands:

  • With curl: curl -LJO "replace this text with the URL"

  • With wget: wget "replace this text with the URL"

And get the signature from pressing the Checksum (SHA256) button next to the .tar.gz download button. This should be the same as displayed in the second column, output from running sha256sum "the downloaded file path goes here". If they are not the same, delete the files and re-download them.

Next up, extract the file with: tar xzf "the downloaded file path goes here". There should now be a directory named something like jdk-16.0.1+1/. You can safely delete the tar.gz file if this is the case.

Now you should add an environment variable called JAVA_HOME pointing to the directory you created (e.g. /usr/lib/jvm/jdk-16.0.1+1; note there is no trailing slash here):

# cat <<EOF | tee /etc/profile.d/java.sh
export JAVA_HOME=/usr/lib/jvm/jdk-16.0.1+1
export PATH=$JAVA_HOME/bin:"$PATH"
EOF
# chmod +x /etc/profile.d/java.sh

Note

The # at the start means this has to be run as either root, or an account that has access to the /etc/profile.d/ directory. To avoid this, you can replace tee with sudo tee (or doas tee on BSD), and replace chmod with sudo chmod (or doas chmod on BSD).

You must now source the new file you created, which is usually done at the start of a shell, so you can just re-open the shell. Alternatively, run source /etc/profile.d/java.sh.

Windows 10

If you’re on Windows 10, you will want AdoptOpenJDK’s JRE. You can find the msi file you should install on their website.

Remember to reboot your computer after installing.

Checking version

If you now open a new PowerShell prompt and do java -version, it should say something along the lines of:

openjdk version "16.0.1" 2021-04-20
OpenJDK Runtime Environment AdoptOpenJDK-16.0.1+9 (build 16.0.1+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK-16.0.1+9 (build 16.0.1+9, mixed mode, sharing)

It is the version "16.0.1" part that is important – if the first number is not 16, you need to modify your PATH.

Modifying your PATH

Press your Windows button and search (just start typing) environment variable. The Edit the system environment variables result is the one you want.

../_images/windows-env-var-search.png

Press the Environment Variables... button:

../_images/windows-env-var-button.png

Select the JAVA_HOME variable on the bottom half and press Edit..., OR if the variable is not present, create a new variable with New... in the lower half of the window, and name it JAVA_HOME. You now want to Browse Directory... and find the Java directory under C:\Program Files\AdoptOpenJDK in the Windows Explorer window:

../_images/windows-browse-directory.png

Now go to your Path variable in the lower window and press Edit.... If there is already a %JAVA_HOME%\bin entry in the list, skip this step. Otherwise, press the New button at the top and enter %JAVA_HOME%\bin:

../_images/windows-add-to-path.png

If you now open a new PowerShell window, you should have the correct output. If not, restart your computer and try again. If it is still wrong, ask for help in #paper-help on Discord to get further assistance.

macOS / OS X

If you’re on macOS, you can use a tool called Homebrew to install Java. Follow the instructions on their website for how to install it.

To now install Java, open your Terminal app and run the following two commands:

$ brew tap AdoptOpenJDK/openjdk
$ brew install --cask adoptopenjdk16-jre

Note

You can find the complete list of available Java versions on the GitHub page of the Java tap.