Master Minecraft Servers: Install Crafty 4 on CasaOS!

Unlock the full potential of your Minecraft server with Crafty Controller! In this tutorial, we’ll guide you through the steps to install and set up Crafty 4 on CasaOS using BigBearCasaOS. Crafty Controller is a powerful, free, and open-source Minecraft launcher and manager that simplifies server administration with a user-friendly interface. Whether you’re a seasoned server admin or a beginner, this guide will help you get Crafty running in no time. Watch now to take your Minecraft server to the next level!

Installed the CasaOS as per the CasaOS website
How do you use your yaml file

i believe that since minecraft version 1.21+ crafty cannot handle it since java 21 is required by default… so if you are running into the following error.

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

or even this error

Starting net.minecraft.server.Main
Exception in thread “ServerMain” java.lang.ExceptionInInitializerError
at java.base/java.io.FilePermission.init(FilePermission.java:319)
at java.base/java.io.FilePermission.(FilePermission.java:490)
at java.base/sun.net.www.protocol.file.FileURLConnection.getPermission(FileURLConnection.java:217)
at java.base/java.net.URLClassLoader.getPermissions(URLClassLoader.java:725)
at java.base/java.security.SecureClassLoader$1.apply(SecureClassLoader.java:227)
at java.base/java.security.SecureClassLoader$1.apply(SecureClassLoader.java:222)
at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708)
at java.base/java.security.SecureClassLoader.getProtectionDomain(SecureClassLoader.java:222)
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:714)
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:420)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:593)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:534)
at java.base/java.lang.Class.forName(Class.java:513)
at net.minecraft.bundler.Main.lambda$run$0(Main.java:52)
at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.lang.RuntimeException: Invalid jdk.io.permissionsUseCanonicalPath: false
at java.base/sun.security.util.FilePermCompat.(FilePermCompat.java:58)
… 21 more

run the following commands (for aarch64)

  1. Ensure container is running

docker start crafty-container

2) Download & extract Temurin JDK 21 instead of JRE

curl -sSL
https://api.adoptium.net/v3/binary/latest/21/ga/linux/aarch64/jdk/hotspot/normal/adoptium
-o temurin-jdk21.tar.gz

3) Copy the archive into the container

docker cp temurin-jdk21.tar.gz crafty-container:/tmp/

4) In-container: unpack into /opt/jdk21 and symlink java & keytool

docker exec -u root crafty-container sh -c "
mkdir -p /opt/jdk21 &&
tar xzf /tmp/temurin-jdk21.tar.gz -C /opt/jdk21 --strip-components=1 &&
ln -sf /opt/jdk21/bin/java /usr/local/bin/java &&
ln -sf /opt/jdk21/bin/keytool /usr/local/bin/keytool
"

5) Restart container & tail logs

docker restart crafty-container
docker logs -f crafty-container