Skip to main content
This guide walks you through building Paper from source code. Paper requires JDK 21 and an internet connection to compile.

Prerequisites

Paper requires JDK 21 to build. The build system uses Gradle’s Toolchains feature, which can automatically provision JDK 21 for compilation if you have JRE 17 or later installed.
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.
WSL 2 is available on Windows 10 version 2004 (build 19041) or higher. You can check your version by running winver. To set up WSL 2:
  1. Follow the official WSL installation guide
  2. Install Ubuntu from the Microsoft Store
  3. Install required tools: sudo apt-get update && sudo apt-get install git -y
  4. Install a Java 21 JDK from Adoptium

Build Steps

1

Clone the repository

Clone the Paper repository to your local machine:
git clone https://github.com/PaperMC/Paper.git
cd Paper
2

Apply patches

Apply Paper’s patches to create the modified Minecraft source:
./gradlew applyPatches
This command applies Paper’s modifications to the Minecraft source files. The process may take several minutes on the first run.
3

Build the server

Compile Paper into a runnable JAR file:
./gradlew createMojmapBundlerJar
The first build will download all necessary dependencies and may take 5-15 minutes depending on your internet connection and hardware.
4

Locate the compiled JAR

After a successful build, find your compiled server JAR at:
paper-server/build/libs/paper-server-<version>.jar
This JAR file is ready to run as a Minecraft server.

Build Outputs

Paper’s build system can create several different JAR formats:
Build TaskOutput LocationDescription
createMojmapBundlerJarpaper-server/build/libs/Mojang-mapped bundler JAR (recommended for development)
createReobfBundlerJarpaper-server/build/libs/Reobfuscated bundler JAR (production)
createMojmapPaperclipJarpaper-server/build/libs/Mojang-mapped Paperclip JAR
createReobfPaperclipJarpaper-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:
docker run -it -v "$(pwd)":/data --rm eclipse-temurin:21.0.5_11-jdk bash
Once inside the container:
cd /data
./gradlew applyPatches
./gradlew createMojmapBundlerJar

Troubleshooting

Build fails with “JAVA_HOME not set”

Ensure JDK 21 is installed and JAVA_HOME environment variable points to your JDK installation:
export JAVA_HOME=/path/to/jdk-21

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

Build docs developers (and LLMs) love