Prerequisites
Before you begin, ensure you have:- Git - Version control system
- JDK 21 or later - Adoptium provides builds for most operating systems
- Internet connection - Required for downloading dependencies
Windows Users
If you’re on Windows, it’s highly recommended to use WSL 2 (Windows Subsystem for Linux) for significantly faster build times.
winver.
To set up WSL 2:
- Follow the official WSL installation guide
- Install Ubuntu from the Microsoft Store
- Install required tools:
sudo apt-get update && sudo apt-get install git -y - Install a Java 21 JDK from Adoptium
Build Steps
Apply patches
Apply Paper’s patches to create the modified Minecraft source:This command applies Paper’s modifications to the Minecraft source files. The process may take several minutes on the first run.
Build the server
Compile Paper into a runnable JAR file:
The first build will download all necessary dependencies and may take 5-15 minutes depending on your internet connection and hardware.
Build Outputs
Paper’s build system can create several different JAR formats:| Build Task | Output Location | Description |
|---|---|---|
createMojmapBundlerJar | paper-server/build/libs/ | Mojang-mapped bundler JAR (recommended for development) |
createReobfBundlerJar | paper-server/build/libs/ | Reobfuscated bundler JAR (production) |
createMojmapPaperclipJar | paper-server/build/libs/ | Mojang-mapped Paperclip JAR |
createReobfPaperclipJar | paper-server/build/libs/ | Reobfuscated Paperclip JAR (production) |
Mojmap vs Reobf: Mojang-mapped JARs use readable names for better debugging. Reobfuscated JARs are optimized for production use.
Docker Build
You can also compile Paper using Docker with Adoptium’s official images:Troubleshooting
Build fails with “JAVA_HOME not set”
Ensure JDK 21 is installed andJAVA_HOME environment variable points to your JDK installation:
Out of memory errors
The build system automatically allocates 1GB of memory for compilation. If you encounter OOM errors, increase available system memory or close other applications.Slow build times on Windows
Switch to WSL 2 for significantly faster build performance. Native Windows builds can be 5-10x slower than WSL 2.Next Steps
- View available Gradle tasks
- Set up your development environment
- Read the CONTRIBUTING.md for patch development guidelines