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.

EnviroMC

EnviroMC defaults to Java 16 if you select Paper as your server jar. To manually change your Java version, please navigate to the Startup -> Docker Image option, and select Java 16, as shown below.

../_images/enviro-java-version.png

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.

Minehub

Minehub will automatically set the Java version to Java 16 when selecting 1.17. You can also set the Java version yourself under Select Java version.

../_images/minehub-java-version.png

Nitrado

If you create a 1.17 server the Java version will be set to Java 16 out of the box. However if it doesn’t (because e.g. you upgraded the server manually) you can set the Java version under “General” -> “Java”

../_images/nitrado-settings-panel.png

../_images/nitrado-java-settings.png

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.

ServerFlex

ServerFlex defaults to Java 8, but will automatically select Java 16 where appropriate. To manually configure the java version, navigate to the settings page, and select Java Version. More information can be found in ServerFlex’s support article.

../_images/serverflex-java-version.png

Server.pro

Creating a server on 1.17 automatically selects Java 16. To manually set the Java version, navigate to the control panel, select Advanced Settings and select Java 16 - HotSpot on the dropdown menu. Save the changes by clicking Save Changes at the bottom of the page.

../_images/serverpro-panel.png

../_images/serverpro-java-version-dropdown.png

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 selecting ghcr.io/pterodactyl/yolks:java_16 from the Image dropdown under Docker Container Configuration. If you are running an older panel version, manually enter the image url in the custom image field. For Java 11, select it from the dropdown instead or replace 16 with 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.

RPM-Based

To install Java 16 on CentOS, RHEL, Fedora, openSUSE, SLES and many other RPM-based distributions, execute the following commands to add Amazon Corretto’s RPM repository and install Java 16.

$ sudo rpm --import https://yum.corretto.aws/corretto.key
$ sudo curl -Lo /etc/yum.repos.d/corretto.repo https://yum.corretto.aws/corretto.repo
$ sudo dnf -y install java-16-amazon-corretto-devel

Arch Linux

To install Java 16 on Arch Linux, you will need to install the jre-openjdk package.

$ sudo pacman -Syu jre-openjdk

To switch between available Java versions on the system with the archlinux-java tool, 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.

Adoptium

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 Adoptium’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 Adoptium’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 Temurin-16.0.2+7 (build 16.0.2+7)
OpenJDK 64-Bit Server VM Temurin-16.0.2+7 (build 16.0.2+7, 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 in the System variables section in the bottom half of the window 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\Eclipse Foundation in the Windows Explorer window:

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

Now go to your Path variable in the System variables section in the bottom half of the 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 command:

$ brew install --cask temurin

If you used AdoptOpenJDK previously, uninstall and untap it.

$ brew uninstall adoptopenjdk16-jre
$ brew untap AdoptOpenJDK/openjdk