Docker deployments of MineOS currently still only package a single Java version. This is causing issues because the latest Minecraft 1.17 does not run on this old version, while older versions of Minecraft do not run well on the newer Java.
This short tutorial will help docker users add Java to their server. Note, the steps to add Java to your existing non-docker server are pretty much the same, with regard to file locations and steps, but all the docker copying and volume portions would not apply.
This tutorial assumes you have a working MineOS docker deployment already.
download the latest Java binary–specifically the compressed tarball file for your preferred architecture from Oracle.
copy this file to your MineOS host (the host running the docker daemon).
scp jdk-16.0.1_linux-x64_bin.tar.gz will@host:/home/will/
copy this file into your docker instance using
(In this example, container is named named
docker cp jdk-16.0.1_linux-x64_bin.tar.gz mineos:/var/games/minecraft/
- enter the container and extract the java binaries:
root@host # docker exec -it mineos /bin/bash root@b260116662e0:/# cd /var/games/minecraft root@b260116662e0:/var/games/minecraft# tar -xf jdk-16.0.1_linux-x64_bin.tar.gz root@b260116662e0:/var/games/minecraft# ls archives backups servers profiles jdk-16.0.1 jdk-16.0.1_linux-x64_bin.tar.gz
- Lastly, set the server to use this binary with the
server.config. There are many ways to accomplish this, but I’ll choose the one that allows me to complete it within this session.
root@b260116662e0:/var/games/minecraft # cd /var/games/minecraft/servers/117serv/ root@b260116662e0:/var/games/minecraft/servers/117serv# cat server.config [java] java_binary= java_xmx=512 jarfile=minecraft_server.1.17.jar [onreboot] start=false [minecraft] profile=1.17 root@b260116662e0:/var/games/minecraft/servers/117serv# sed -i '2s|$|/var/games/minecraft/jdk-16.0.1/bin/java|' server.config [java] java_binary=/var/games/minecraft/jdk-16.0.1/bin/java java_xmx=512 jarfile=minecraft_server.1.17.jar [onreboot] start=false [minecraft] profile=1.17
- And then start the server!
[17:15:13] [Worker-Main-4/INFO]: Loaded 1137 advancements [17:15:16] [Server thread/INFO]: Starting minecraft server version 1.17 [17:15:16] [Server thread/INFO]: Loading properties [17:15:16] [Server thread/INFO]: Default game type: SURVIVAL [17:15:16] [Server thread/INFO]: Generating keypair [17:15:16] [Server thread/INFO]: Starting Minecraft server on 0.0.0.0:25565 [17:15:16] [Server thread/INFO]: Using epoll channel type