• Stars
    star
    347
  • Rank 122,141 (Top 3 %)
  • Language
    Shell
  • License
    MIT License
  • Created about 2 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Use GraalVM Native Image to turn the Minecraft server into native executables that are small in footprint, fast, and cheap to deploy.

Native Minecraft Servers with GraalVM Native Image

Build Native Minecraft Server

Banner

The Minecraft server is known to require a lot of CPU and memory resources and can be hard to deploy. This project makes it possible to compile the Minecraft server into a self-contained native executable using GraalVM Native Image. As such, it is supposed to require fewer CPU and memory resources, provide better startup times, and be easier and cheaper 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. With upx compression, the size of the native executable can be reduced even further to less than 40MB, which is smaller than just the server.jar. Initial experiments also suggest competitive run-time performance with a reduced memory footprint. For best results, build with GraalVM Enterprise Native Image, which provides better performance and lower memory usage than the Community Edition, and try out the G1 GC and Profile-Guided Optimizations. The Oracle Cloud Free Tier not only provides four Ampere A1 cores and 24 GB of RAM always free, which is plenty for hosting a Minecraft server, but also free access to GraalVM Enterprise.

Check out this blog post for more information.

Disclaimer: This project is meant for demonstration purposes only and intended to help the Minecraft community evaluate the use of GraalVM Native Image. Please use at your own risk.

Getting Started

  1. Download GraalVM Community or Enterprise (GraalVM 22.2.0 or later is required).
    Optional: make sure upx is on your $PATH to enable compression.
  2. Download or check out this repository and run the build.sh.
  3. Launch the native Minecraft server with ./native-minecraft-server.
    The first time you run the server, you will have to follow the regular procedure of accepting Minecraft's EULA.

How It Works

This project only contains the build.sh script and reachability metadata for building a native Minecraft server. The build.sh script first downloads Minecraft's server.jar and extracts jars and other resources from it. Afterward, it invokes GraalVM Native Image with an appropriate configuration to generate a native version of the Minecraft server. Finally, and only if upx is on the $PATH, the script will compress the native executable.

Limitations and Known Issues

  • The configuration currently only supports Minecraft 1.18.2.
  • The server GUI is not yet supported.
  • Mods are currently not supported.
  • There is no build script for Windows yet, but the WSL should work.
  • The native executable sometimes fails on startup. Restarting it a few times usually helps.
    Error: com.mojang.datafixers.types.templates.List$ListType cannot be cast to java.lang.Comparable.

Contributions

Please report any issues here on GitHub and open pull requests if you'd like to contribute to the project.

License

This project is released under the MIT license.

More Repositories

1

trufflesqueak

A Squeak/Smalltalk VM and Polyglot Programming Environment for the GraalVM.
Java
282
star
2

smalltalkCI

Framework for testing Smalltalk projects with GitHub Actions, GitLab CI, Travis CI, AppVeyor, and others.
Smalltalk
94
star
3

ipolyglot

A polyglot kernel for Jupyter notebooks based on GraalVM.
JavaScript
92
star
4

RSqueak

A Squeak/Smalltalk VM written in RPython.
Python
83
star
5

vivide

A Squeak/Smalltalk-based programming environment and framework that supports low-effort construction of graphical tools by employing a data-driven perspective and a script-based programming model.
Smalltalk
59
star
6

Squot

Squeak Object Tracker - Version control for arbitrary objects, currently with Git storage
Smalltalk
58
star
7

polyglot-live-programming

Polyglot Live Programming with GraalVM, the Language Server Protocol (LSP), and VS Code.
Java
38
star
8

sandblocks

A projectional editor for Squeak/Smalltalk.
Smalltalk
35
star
9

Ohm-S

A Squeak/Smalltalk implementation of the metaprogramming framework Ohm.
Smalltalk
24
star
10

setup-smalltalkCI

Use smalltalkCI to test your Smalltalk projects.
JavaScript
23
star
11

Gramada

Gramada is an interactive development environment for programming languages defined in Ohm. It is based on Vivide and implemented in Squeak/Smalltalk.
Smalltalk
15
star
12

MessageSendRecorder

Tracing tool for Squeak/Smalltalk. Includes a debugger-like browser for records.
Smalltalk
10
star
13

animations

An extension for Squeak/Smalltalk that employs a simple programming model for adding animations to the Morphic framework.
Smalltalk
10
star
14

JCop

A COP language extension to Java
Java
9
star
15

Rack

A hierarchical ordering system for objects in Squeak/Smalltalk with a graphical interface
Smalltalk
8
star
16

metacello-git

Git support in Monticello. Deprecated: Use https://github.com/hpi-swa/Squot instead.
Smalltalk
7
star
17

MethodWrappers

Method wrappers from the AspectS project. Compatible with Squeak 5.1 and newer.
Smalltalk
6
star
18

widgets

A set of graphical controls such as tree views and buttons implemented in Squeak/Smalltalk using the Signals observer pattern.
Smalltalk
6
star
19

smalltalk-nested-classes

Module System for Squeak based on Nested Classes
Smalltalk
5
star
20

signals

An observer mechanism inspired by the Qt framework and implemented in Squeak/Smalltalk.
Smalltalk
4
star
21

squeak-history

Project for Squeak 5.2 (and above) to explore and learn about the history of Squeak and Squeak-related projects.
Smalltalk
4
star
22

SmalltalkWordNet

Provides an object representation of the wordnet database
Smalltalk
3
star
23

context-s

A COP language extension for Squeak/Smalltalk
HTML
2
star