Once your Codespace is Ready it will be Opened.

Once your Codespace is Ready it will be Opened.


- 2 commits

Native Minecraft Servers using GraalVM Native Image

The Minecraft server can be difficult to deploy because it requires a large amount of memory and CPU resources. This project allows to convert the Minecraft server into an independent executable that is self-contained using GraalVM Native Image. It is anticipated to make use of less CPU and memory resources, be faster to start, and be easier to deploy.

A native Minecraft server is less than 120MB in size and, with that, significantly smaller than Minecraft's server.jar plus a JDK required to run it. The native executable can be compressed further to shrink its size to less than 40MB. This is smaller than the server.jar. Initial experiments also suggest that the run-time performance can be competitive due to less footprint of memory. For the best results, build with GraalVM Enterprise Native Image, which has better performance and lower memory usage than the Community Edition, and try using the G1 GC and Profile-Guided Optimizations. The Oracle Cloud Free Tier not only offers four Ampere A1 cores and 24 GB of RAM that is enough to host the Minecraft server and also provides access to GraalVM Enterprise.

For more information, refer to this blog post.

Disclaimer This project is intended to be used only for demonstration purposes. It's meant to assist the Minecraft community assess the use of GraalVM Native Image. Use at your own risk

1. Download GraalVM Community or Enterprise (GraalVM 22.2.0 or later is required). Optional: Ensure that upx is installed on your $PATH in order to enable compression. 2. Check out the repository and download it. Then run build.sh. 3. Launch the native Minecraft server with ./native-minecraft-server. You must agree to Minecraft's EULA the first time you launch the server.

How it works

This project only contains the build.sh script along with reachability metadata and instructions to create a native Minecraft server. The build.sh script downloads Minecraft's server.jar first and extracts the jars it contains. It then calls GraalVM native image with the correct configuration to create an original Minecraft server. MINECRAFT SERVER LIST Finally, and only if upx is on the $PATH script, it will compress the native executable.

Limitations and issues that are known

- The configuration currently only supports Minecraft 1.18.2. - The server GUI is not yet supported. Mods are not currently supported. There is no build script for Windows, but the WSL should be able to function. - The native executable sometimes fails on startup. It is typically possible to restart it multiple times. Error: com.mojang.datafixers.types.templates.List$ListType cannot be cast to java.lang.Comparable.

Report Page