How do I upgrade to OpenJDK 16 for Minecraft 1.17
I deployed a Linode using the Minecraft Marketplace App awhile ago and I just updated it to Minecraft v1.17. Now I'm trying to update Java since it won't start but I keep getting 404 errors for the Java repos.
# apt-get update
Ign:1 http://mirrors.linode.com/debian stretch InRelease
Hit:2 http://mirrors.linode.com/debian-security stretch/updates InRelease
Hit:3 http://mirrors.linode.com/debian stretch-updates InRelease
Hit:4 http://mirrors.linode.com/debian stretch Release
Ign:5 http://ppa.launchpad.net/webupd8team/java/ubuntu groovy InRelease
Ign:7 http://ppa.launchpad.net/webupd8team/java/ubuntu groovy Release
Ign:8 http://ppa.launchpad.net/webupd8team/java/ubuntu groovy/main all Packages
Ign:9 http://ppa.launchpad.net/webupd8team/java/ubuntu groovy/main amd64 Packages
Ign:10 http://ppa.launchpad.net/webupd8team/java/ubuntu groovy/main i386 Packages
Ign:11 http://ppa.launchpad.net/webupd8team/java/ubuntu groovy/main Translation-en
Ign:12 http://ppa.launchpad.net/webupd8team/java/ubuntu groovy/main Translation-en_US
Ign:8 http://ppa.launchpad.net/webupd8team/java/ubuntu groovy/main all Packages
Ign:9 http://ppa.launchpad.net/webupd8team/java/ubuntu groovy/main amd64 Packages
Ign:10 http://ppa.launchpad.net/webupd8team/java/ubuntu groovy/main i386 Packages
Ign:11 http://ppa.launchpad.net/webupd8team/java/ubuntu groovy/main Translation-en
Ign:12 http://ppa.launchpad.net/webupd8team/java/ubuntu groovy/main Translation-en_US
Ign:8 http://ppa.launchpad.net/webupd8team/java/ubuntu groovy/main all Packages
Ign:9 http://ppa.launchpad.net/webupd8team/java/ubuntu groovy/main amd64 Packages
Ign:10 http://ppa.launchpad.net/webupd8team/java/ubuntu groovy/main i386 Packages
Ign:11 http://ppa.launchpad.net/webupd8team/java/ubuntu groovy/main Translation-en
Ign:12 http://ppa.launchpad.net/webupd8team/java/ubuntu groovy/main Translation-en_US
Ign:8 http://ppa.launchpad.net/webupd8team/java/ubuntu groovy/main all Packages
Ign:9 http://ppa.launchpad.net/webupd8team/java/ubuntu groovy/main amd64 Packages
Ign:10 http://ppa.launchpad.net/webupd8team/java/ubuntu groovy/main i386 Packages
Ign:11 http://ppa.launchpad.net/webupd8team/java/ubuntu groovy/main Translation-en
Ign:12 http://ppa.launchpad.net/webupd8team/java/ubuntu groovy/main Translation-en_US
Ign:8 http://ppa.launchpad.net/webupd8team/java/ubuntu groovy/main all Packages
Ign:9 http://ppa.launchpad.net/webupd8team/java/ubuntu groovy/main amd64 Packages
Ign:10 http://ppa.launchpad.net/webupd8team/java/ubuntu groovy/main i386 Packages
Ign:11 http://ppa.launchpad.net/webupd8team/java/ubuntu groovy/main Translation-en
Ign:12 http://ppa.launchpad.net/webupd8team/java/ubuntu groovy/main Translation-en_US
Ign:8 http://ppa.launchpad.net/webupd8team/java/ubuntu groovy/main all Packages
Err:9 http://ppa.launchpad.net/webupd8team/java/ubuntu groovy/main amd64 Packages
404 Not Found
Ign:10 http://ppa.launchpad.net/webupd8team/java/ubuntu groovy/main i386 Packages
Ign:11 http://ppa.launchpad.net/webupd8team/java/ubuntu groovy/main Translation-en
Ign:12 http://ppa.launchpad.net/webupd8team/java/ubuntu groovy/main Translation-en_US
Reading package lists... Done
W: The repository 'http://ppa.launchpad.net/webupd8team/java/ubuntu groovy Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch http://ppa.launchpad.net/webupd8team/java/ubuntu/dists/groovy/main/binary-amd64/Packages 404 Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
How can I fix this?
2 Replies
The first thing you'll want to do is remove the orignal Java install and the repo it came from. We'll also want to install apt-transport-https
which will allow us to pull from the new repo using HTTPS that we'll be configuring in a bit. You can use the commands below to do this.
sudo apt purge openjdk-* -y
sudo add-apt-repository –remove ppa:webupd8team/java
sudo apt install -y apt-transport-https
Now, we'll want to setup the new repo that contains OpenJDK 16 which is required for Minecraft v1.17. You'll want to follow the steps in the Zulu OpenJDK installation docs to get the new repo configured.
Once you've configured the new repo, all you'll need to do is run sudo apt-get install zulu16-jdk-headless -y
which will install OpenJDK 16 and get your Minecraft server back up and running.
You could also try, sudo apt install openjdk-16-jdk
I just updated openjdk in order to update my Minecraft server to the new 1.17 version (you cannot run 1.17 Minecraft server without updating to Java 16). I had openjdk-11 previously and the above command clobbered the older version.
Before:
root@li99-146:/opt/minecraft/server# java --version
openjdk 11.0.11 2021-04-20
OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.20.04)
OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.20.04, mixed mode, sharing)
After:
root@li99-146:/opt/minecraft/server# java --version
openjdk 16.0.1 2021-04-20
OpenJDK Runtime Environment (build 16.0.1+9-Ubuntu-120.04)
OpenJDK 64-Bit Server VM (build 16.0.1+9-Ubuntu-120.04, mixed mode, sharing)