Updating to Java 17
Paper will only support Java 17 and above because of Mojang Studios deciding to bump their own Java requirement with 1.18.
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).
The RPM, Ubuntu/Debian and Windows instructions below use Amazon Corretto as OpenJDK vendor. It’s worth to note that Corretto is not the only OpenJDK vendor to choose from, you are free to use a different one like Azul Zulu or Microsoft.
To update, please find the appropriate header for you in the table of contents.
To switch the Java version on Pterodactyl on a version lower than v1.2.0,
you will require an administrator account. On versions later than v1.2.0,
you can select it in the
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_17 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.
To install Java 17 on Debian, Ubuntu, and the plethora of other distributions based on these, execute the following commands to add the Corretto apt repository and to install OpenJDK Hotspot:
$ sudo apt-get install software-properties-common $ wget -O- https://apt.corretto.aws/corretto.key | sudo apt-key add - $ sudo add-apt-repository 'deb https://apt.corretto.aws stable main' $ sudo apt-get update $ sudo apt-get install -y java-17-amazon-corretto-jdk
To install Java 17 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 17.
$ 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-17-amazon-corretto-devel
$ sudo zypper addrepo https://yum.corretto.aws/corretto.repo $ sudo zypper refresh $ sudo zypper install java-17-amazon-corretto-devel
$ 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 yum -y install java-17-amazon-corretto-devel
$ sudo pacman -Syu jdk-openjdk
To switch between available Java versions on the system with the archlinux-java tool, see the wiki on Switching between JVMs.
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
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.
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.
You are going to require the
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
/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:
curl -LJO "replace this text with the URL"
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
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-17.0.1+12; note there is no
trailing slash here):
# cat <<EOF | tee /etc/profile.d/java.sh export JAVA_HOME=/usr/lib/jvm/jdk-17.0.1+12 export PATH=$JAVA_HOME/bin:"$PATH" EOF # chmod +x /etc/profile.d/java.sh
# 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
sudo tee (or
doas tee on BSD),
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
If you’re on Windows 10 or 11, you can download Corretto’s JDK. You can find the
msi file you should install on their website.
Remember to reboot your computer after installing.
If you now open a new PowerShell prompt and do
java -version, it should say
something along the lines of:
openjdk version "17" 2021-09-14 LTS OpenJDK Runtime Environment Corretto-188.8.131.52.1 (build 17+35-LTS) OpenJDK 64-Bit Server VM Corretto-184.108.40.206.1 (build 17+35-LTS, mixed mode, sharing)
It is the
version "17.0.1" part that is important – if the first number is
17, you need to modify your
PATH. Corretto’s installer will set this
automatically, no interaction needed.
Press your Windows button and search (just start typing)
Edit the system environment variables result is the one
Environment Variables... button:
JAVA_HOME variable in the
System variables section in the
bottom half of the window and press
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
Directory... and find the Java directory under
Files\Amazon Corretto in the Windows Explorer window:
Now go to your
Path variable in the
System variables section in the
bottom half of the window and press
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
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.
To now install Java, open your Terminal app and run the following command:
$ brew install openjdk
If you used AdoptOpenJDK previously, uninstall and untap it.
$ brew uninstall adoptopenjdk16-jre $ brew untap AdoptOpenJDK/openjdk