Minecraft Server not launching 1.20.6

FYI – this Minecraft Server is running on Debian 11, Bullseye. So if the solution does not work for you, maybe try the attempts listed here.

If you’re experiencing an issue when launching the Minecraft server, where it shows the following:
java -Xms1G -Xmx2560M -jar minecraft_server.1.20.6.jar nogui
Error: LinkageError occurred while loading main class net.minecraft.bundler.Main
java.lang.UnsupportedClassVersionError: net/minecraft/bundler/Main has been compiled by a more recent version of the Java Runtime (class file version 65.0), this version of the Java Runtime only recognizes class file versions up to 61.0

… it is most likely caused by a wrong version of Java. As Minecraft Server 1.20.4 worked just fine on openjdk-17, I expected 1.20.6 to work as well, however, evidently not.

1. Attempts to solve

1.1 Update the system

I did run the update, upgrade and removing unused packages, to make sure I didn’t miss any updates on the openjdk 17, currently installed.

sudo apt update && sudo apt upgrade
sudo apt autoremove

However this appeared to solve nothing, though plenty of updates were available.

1.2 Re-install openjdk-17

I then attempted to re-install the openjdk-17 entirely by running the following commands:

sudo apt purge openjdk-17*
sudo apt install openjdk-17*

Unfortunately this also did not solve my issue.

2. Solution

The thing that solved it for me was to indeed purge openjdk-17 first, as described in step 1.2, without re-installing. However, I opted to update and install openjdk-21

wget https://download.oracle.com/java/21/latest/jdk-21_linux-x64_bin.deb
sudo dpkg -i jdk-21_linux-x64_bin.deb

I then confirmed my new java version, using:

java --version

java 21.0.3 2024-04-16 LTS
Java(TM) SE Runtime Environment (build 21.0.3+7-LTS-152)
Java HotSpot(TM) 64-Bit Server VM (build 21.0.3+7-LTS-152, mixed mode, sharing)

This solved my issue and my Minecraft Server came back up as soon as I ran the Minecraft Server launch command again…

java -Xms1G -Xmx2560M -jar minecraft_server.1.20.6.jar nogui

Good luck!

Over’n’Out,

Brian

Related Posts

One thought on “Minecraft Server not launching 1.20.6

Leave a Reply

Your email address will not be published. Required fields are marked *