Hay, if it is a regular upgrade of the Minecraft Java server edition, I won’t write a post here. Because it is quite straightforward.
Say a normal upgrade.
ssh to the server with Putty.
sudo /opt/minecraft/tools/backup.sh
sudo service minecraft stop
wget the latest java Minecraft server file, at Minecraft’s official website, save it as /opt/minecraft/server/server.jar (Rename the old server.jar to server.jar.old)
sudo service minecraft start
Then I can use my TLauncher to access the server from my desktop without problems.
Today, when I finished the procedures above(My current version is 1.20.4 on server.), I could not connect to Minecraft from my desktop. I checked the release notes of 1.20.6, it is a small bug fix upgrade. Then, I checked the 1.20.5 release notes, Wow, it is a big upgrade. It said 1.20.5 is the first version of Java Edition to require a 64-bit operation and Java 21.
I believe my server is 64-bit. The leftover is Java 21.
I checked the Minecraft service status and the Java version.
davidyin@minecraft:/opt/minecraft/server$ sudo service minecraft status ● minecraft.service - Minecraft Server Loaded: loaded (/etc/systemd/system/minecraft.service; enabled; vendor preset: enabled) Active: inactive (dead) since Fri 2024-05-03 05:08:58 UTC; 4min 52s ago Process: 1121 ExecStart=/usr/bin/java -Xmx5102M -Xms1024M -jar server.jar nogui (code=exited, status=1/FAILURE) Process: 1150 ExecStop=/opt/minecraft/tools/mcrcon/mcrcon -H 127.0.0.1 -P 25575 -p izpait stop (code=exited, status=1/FAI> Main PID: 1121 (code=exited, status=1/FAILURE) May 03 05:08:58 minecraft systemd[1]: Started Minecraft Server. May 03 05:08:58 minecraft java[1121]: Error: LinkageError occurred while loading main class net.minecraft.bundler.Main May 03 05:08:58 minecraft java[1121]: java.lang.UnsupportedClassVersionError: net/minecraft/bundler/Main has been com> May 03 05:08:58 minecraft mcrcon[1150]: Connection failed. May 03 05:08:58 minecraft mcrcon[1150]: Error 111: Connection refused May 03 05:08:58 minecraft systemd[1]: minecraft.service: Succeeded.
Look, Active: inactive (dead)
davidyin@minecraft:/opt/minecraft/server$ java -version openjdk version "17.0.10" 2024-01-16 OpenJDK Runtime Environment (build 17.0.10+7-Ubuntu-120.04.1) OpenJDK 64-Bit Server VM (build 17.0.10+7-Ubuntu-120.04.1, mixed mode, sharing)
The Java is version 17.0.10. So, the problem is the Java version requirement.
Go to Oracle page
https://www.oracle.com/java/technologies/downloads/#java21
At my home folder of the server, I run the following command.
wget https://download.oracle.com/java/21/latest/jdk-21_linux-x64_bin.deb sudo apt install ./jdk-21_linux-x64_bin.deb davidyin@minecraft:~$ java -version java version "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)
Now, it is the Java 21.0.3.
All I have to do is to restart the Minecraft server service.
davidyin@minecraft:~$ sudo service minecraft restart davidyin@minecraft:~$ sudo service minecraft status ● minecraft.service - Minecraft Server Loaded: loaded (/etc/systemd/system/minecraft.service; enabled; vendor preset: enabled) Active: active (running) since Fri 2024-05-03 05:19:40 UTC; 6s ago Main PID: 1521 (java) Tasks: 25 (limit: 7006) Memory: 417.0M CGroup: /system.slice/minecraft.service └─1521 /usr/bin/java -Xmx5102M -Xms1024M -jar server.jar nogui May 03 05:19:40 minecraft java[1521]: Unpacking commons-io/commons-io/2.15.1/commons-io-2.15.1.jar (libraries:commons-io:comm> May 03 05:19:40 minecraft java[1521]: Unpacking net/java/dev/jna/jna/5.14.0/jna-5.14.0.jar (libraries:net.java.dev.jna:jna:5.> May 03 05:19:40 minecraft java[1521]: Unpacking net/java/dev/jna/jna-platform/5.14.0/jna-platform-5.14.0.jar (libraries:net.j> May 03 05:19:40 minecraft java[1521]: Unpacking org/apache/commons/commons-lang3/3.14.0/commons-lang3-3.14.0.jar (libraries:o> May 03 05:19:40 minecraft java[1521]: Unpacking org/apache/logging/log4j/log4j-api/2.22.1/log4j-api-2.22.1.jar (libraries:org> May 03 05:19:40 minecraft java[1521]: Unpacking org/apache/logging/log4j/log4j-core/2.22.1/log4j-core-2.22.1.jar (libraries:o> May 03 05:19:40 minecraft java[1521]: Unpacking org/apache/logging/log4j/log4j-slf4j2-impl/2.22.1/log4j-slf4j2-impl-2.22.1.ja> May 03 05:19:40 minecraft java[1521]: Unpacking org/lz4/lz4-java/1.8.0/lz4-java-1.8.0.jar (libraries:org.lz4:lz4-java:1.8.0) > May 03 05:19:40 minecraft java[1521]: Unpacking org/slf4j/slf4j-api/2.0.9/slf4j-api-2.0.9.jar (libraries:org.slf4j:slf4j-api:> May 03 05:19:40 minecraft java[1521]: Starting net.minecraft.server.Main lines 1-19/19 (END)
See the screenshot.