williamcorsel / hassio-addons

My homeassistant addons
MIT License
12 stars 12 forks source link

java.lang.UnsupportedClassVersionError: net/minecraft/bundler/Main has been compiled by a more recent version of the Java Runtime (class file version 65.0) #19

Closed GianSeven closed 1 month ago

GianSeven commented 1 month ago
-----------------------------------------------------------
 Add-on: HAMC Server Java
 Host a Java Minecraft server on Home Assistant
-----------------------------------------------------------
 Add-on version: 1.0.0
 You are running the latest version of this add-on.
 System: Debian GNU/Linux 12 (bookworm)  (amd64 / qemux86-64)
 Home Assistant Core: 2024.7.3
 Home Assistant Supervisor: 2024.06.2
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums
 https://github.com/williamcorsel/hassio-addons
-----------------------------------------------------------
/etc/cont-init.d/options_to_env.sh: executing
ALLOW_NETHER='true'
ANNOUNCE_PLAYER_ACHIEVEMENTS='true'
DIFFICULTY='normal'
ENABLE_COMMAND_BLOCK='false'
FORCE_GAMEMODE='false'
GAMEMODE='survival'
HARDCORE='false'
LEVEL='World'
MAX_BUILD_HEIGHT='512'
MAX_PLAYERS='3'
MAX_WORLD_SIZE='29999984'
MEMORY='2G'
MOTD='Greetings from Home Assistant'
ONLINE_MODE='true'
OPS=''
PVP='true'
SEED=''
SERVER_NAME='HAMC Java Server'
SPAWN_PROTECTION='0'
VERSION='LATEST'
VIEW_DISTANCE='10'
WHITELIST=''
/etc/cont-init.d/run.sh: executing
[17:43:35] INFO: Starting...
[init] Running as uid=1000 gid=1000 with /data as 'drwxrwxr-x 2 1000 1000 4096 Jul 25 17:43 /data'
[init] Resolved version given LATEST into 1.21 and major version 1.21
[init] Resolving type given VANILLA
[init] Setting initial memory to 2G and max to 2G
[init] Starting the Minecraft server...
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
2024-07-25T17:43:42.179+0200    WARN    mc-server-runner    Minecraft server failed. Inspect logs above for errors that indicate cause. DO NOT report this line as an error.    {"exitCode": 1}
2024-07-25T17:43:42.179+0200    INFO    mc-server-runner    Done
/etc/cont-init.d/run.sh: exiting 1

This is what I get when I try to start the addon. I'm no expert in either Java or Linux itself but I tried to install OpenJDK 21 (version 65.0) and temurin-21-jre but it didn't work

williamcorsel commented 1 month ago

This is strange, what device are you running on? I can't replicate the issue from my side.

GianSeven commented 1 month ago

An i3 4170 desktop running headless debian 12 that I use just for Home Assistant

williamcorsel commented 1 month ago

This was an issue with the underlying docker container https://github.com/itzg/docker-minecraft-server/issues/3011. Please refer to the solution posted here. Probably a reinstallation of the add-on, or changing the VERSION in the config to something older, should work fine.