GameServerManagers / LinuxGSM

The command-line tool for quick, simple deployment and management of Linux dedicated game servers.
https://linuxgsm.com
MIT License
4.34k stars 822 forks source link

[Bug]: PaperMC OpenJDK dependency update #4672

Open sotolko opened 2 months ago

sotolko commented 2 months ago

User story

...

Game

Minecraft PaperMC

Linux distro

Debian 12

Command

command: install

Further information

Hello, today I installed fresh Debian 12, and LinuxGSM PaperMC server. When I tried to install that server, I was missing dependency openjdk version "17.0.12" 2024-07-16. So I went to install that, and when I tried to install server again, it was succesfull. However, server was not visible inside of Minecraft, so I tried ./pmcserver debug ,and I recieved error (org/bukkit/craftbukkit/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).

Fixed the issue by installing newer version of JDK, based on PaperMC documentation (https://docs.papermc.io/paper/getting-started) (https://docs.papermc.io/misc/java-install). Now server working as expected.

Relevant log output

[  OK  ] Debuging pmcserver: Starting debug
Starting org.bukkit.craftbukkit.Main
Exception in thread "ServerMain" java.lang.UnsupportedClassVersionError: org/bukkit/craftbukkit/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
        at java.base/java.lang.ClassLoader.defineClass1(Native Method)
        at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
        at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
        at java.base/java.net.URLClassLoader.defineClass(URLClassLoader.java:524)
        at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:427)
        at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:421)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:712)
        at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:420)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:592)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Class.java:467)
        at io.papermc.paperclip.Paperclip.lambda$main$0(Paperclip.java:38)
        at java.base/java.lang.Thread.run(Thread.java:840)
[  OK  ] Debuging pmcserver: Server has stopped
[  OK  ] Debuging pmcserver: Press ENTER to exit debug mode

Steps to reproduce

  1. ./pmcserver install
  2. Dependency missing (openjdk 17)
  3. Install dependency and try again
  4. ./pmcserver details = server STOPPED
  5. ./pmcserver debug
  6. JDK error
sotolko commented 2 months ago

I can see that Debian 12 have openjdk 17 dependency for minecraft, paperMC and waterfallMC.

https://github.com/GameServerManagers/LinuxGSM/blob/master/lgsm/data/debian-12.csv

h3o66 commented 1 month ago

the issue is that debian does not got openjdk 21 in the stable repos . https://packages.debian.org/search?suite=bookworm&searchon=names&keywords=openjdk

the only option i see atm is to use the adoptium packages: https://adoptium.net/de/installation/linux/#_deb_installation_on_debian_or_ubuntu

That needs a additional integration here, or you install that for now yourself till someone adds this.