itzg / docker-minecraft-server

Docker image that provides a Minecraft Server that will automatically download selected version at startup
https://docker-minecraft-server.readthedocs.io/
Apache License 2.0
9.48k stars 1.55k forks source link

Vanilla server startup issue with minecraft_server.1.20.5.jar #2794

Closed tomlarkworthy closed 6 months ago

tomlarkworthy commented 6 months ago

Describe the problem

Recent problem that the latest server doesn't seem to startup for me.

Container definition

docker run --restart always --log-driver=gcplogs -d -p 25565:25565 -p 19132:19132/udp -v /var/minecraft:/data -e "MEMORY=7G" -e "EULA=TRUE" -e "OPS=economic emerald marten,united moccasin chameleon,t_lark,Thatguygamerx,Chillyxxl" --name mc itzg/minecraft-server:latest;

(the memory flag doesn't seem to work but NVM)

Container logs


[init] Running as uid=1000 gid=1000 with /data as 'drwxrwxr-x 9 1000 1000 4096 Apr 21 13:01 /data'
[init] Resolved version given LATEST into 1.20.5
[init] Resolving type given VANILLA
[init] Downloading minecraft_server.1.20.5.jar ...
[init] server.properties already created, skipping
[init] Updating ops
[init] Checking for JSON files.
[init] Setting initial memory to 3G and max to 3G
[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-04-25T17:45:25.567Z WARN mc-server-runner sub-process failed {"exitCode": 1}
2024-04-25T17:45:25.568Z INFO mc-server-runner Done
tomlarkworthy commented 6 months ago
REPOSITORY              TAG       IMAGE ID       CREATED       SIZE
itzg/minecraft-server   latest    33a235aa35e6   2 years ago   873MB
itzg/minecraft-server   java16    409154d896a3   2 years ago   654MB

oh maybe I have ancient image

tomlarkworthy commented 6 months ago

OK it was that, and it fixed the MEMORY flag, lol

[init] Running as uid=1000 gid=1000 with /data as 'drwxrwxr-x 9 1000 1000 4096 Apr 25 18:30 /data'
[init] Resolving type given VANILLA
[init] Resolved version given LATEST into 1.20.5
[init] Downloading 1.20.5 server...
[mc-image-helper] 18:31:00.355 INFO  : Created/updated 1 property in /data/server.properties
[mc-image-helper] 18:31:02.962 INFO  : The file /data/ops.json already exists, so no changes will be made
[init] Setting initial memory to 7G and max to 7G
[init] Starting the Minecraft server...
phalcon23 commented 5 months ago

So what exactly did you do? I'm having the same error, but with version 1.20.6

minecraft-server-mc-1 | [init] Running as uid=1000 gid=1000 with /data as 'drwxr-xr-x 8 1000 1000 4096 Jun 10 17:41 /data' minecraft-server-mc-1 | [init] Autopause functionality enabled minecraft-server-mc-1 | [init] Resolving type given VANILLA minecraft-server-mc-1 | [init] Resolved version given LATEST into 1.20.6 minecraft-server-mc-1 | [init] Setting initial memory to 1G and max to 1G minecraft-server-mc-1 | [init] Starting the Minecraft server... minecraft-server-mc-1 | Error: LinkageError occurred while loading main class net.minecraft.bundler.Main minecraft-server-mc-1 | 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 minecraft-server-mc-1 | 2024-06-10T17:46:14.444Z 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} minecraft-server-mc-1 | 2024-06-10T17:46:14.445Z INFO mc-server-runner Done minecraft-server-mc-1 exited with code 1

itzg commented 5 months ago

Use java21 image tag or re-pull latest

https://docker-minecraft-server.readthedocs.io/en/latest/versions/java/