Dec 23, 2020
  • BuildTools

    Simple instructions to build CraftBukkit and Spigot

    What is it?(top)

    BuildTools.jar is our solution to building Bukkit, CraftBukkit, Spigot, and the Spigot-API. All of which is done on your computer! A few prerequisite programs are necessary, but the instructions below will guide you through everything you need to do.


    There are two applications necessary to use BuildTools: Git and Java.


    What follows below are the manual steps to get BuildTools running on Windows.

    Git - In order for BuildTools to run on Windows, you will need to install Git. For Windows it is distributed via git-scm, which can be downloaded here. Install it where you like, it will provide git bash, which will be used to run the BuildTools jar. Just keep hitting next when running the installer.
    The very latest versions of BuildTools will automatically download and install Git for you. Only grab it manually if you are having troubles!

    Java - Download JRE 8 from here and install. Just keep hitting next when running the installer.


    Both git and Java, as well as util commands, can be installed using a single command via your package manager.
    Debian/Ubuntu: sudo apt-get install git openjdk-8-jre-headless
    CentOS/RHEL: sudo yum install git java-1.8.0-openjdk-devel
    Arch: sudo pacman -S jdk8-openjdk git


    Git can be downloaded from:

    Java may need to be updated from the Apple distributed version, and even if previously updated, may need to be linked for shell use.
    Please follow steps found here:

    Running BuildTools(top)

    1. Download BuildTools.jar from
      1. Keep watch on for any bug fixes and updates
      2. If you wish to download this from the command line, use either curl -o BuildTools.jar <url> or wget -O BuildTools.jar <url> using the link described in the first step.
      3. Spaces or exclamation points in the directory path may break BuildTools! It is recommended to remove these.
    2. Open your terminal if you are on Linux, or git bash on Windows.
      1. Git bash can be found on the desktop or in the Start menu under the name "git bash". It's also possible to open it by right-clicking on anything, as it is now an item in your context menu.
    3. Navigate to where you downloaded BuildTools.jar, or use the command line way to download the jar to your current directory.
      1. On Windows, you can either use the cd command to change directories, or you can right click the blank space of the folder where BuildTools.jar is (DO NOT click BuildTools.jar itself) and click "git bash", which will open it in your current directory.
    4. Run BuildTools.jar from the terminal (Do not double-click BuildTools.jar) by doing the following:
      1. On Linux run git config --global --unset core.autocrlf, then run java -jar BuildTools.jar in bash or another appropriate shell.
      2. On Windows run the below command inside the git bash window that opened:
        1. java -jar BuildTools.jar
        2. Please be aware that it is required that you have BuildTools #35 or later, older versions will not work.
      3. On Mac run the below commands,
        1. export MAVEN_OPTS="-Xmx2G"
          java -Xmx2G -jar BuildTools.jar
      4. Options (all OS's) :
        • The --rev option can be used to get specific 1.8/1.9 versions of CraftBukkit / Spigot
        • See Versions below for available options
    5. (Optional) on Windows create a batch (.bat) file using this code to automate the install process:
      1. Code (Text):
        @echo off
        IF NOT EXIST BuildTools (
            mkdir BuildTools
        cd BuildTools
        curl -z BuildTools.jar -o BuildTools.jar
        set /p Input=Enter the version: || set Input=latest
        java -jar BuildTools.jar --rev %Input%
      1. This batch script will create a directory in which BuildTools.jar will be downloaded if it doesn't exist or if there is a newer one available. After that you will get asked which Spigot version you want to compile If you press enter without defining which version you want, it will compile the latest version. Then it will run java -jar BuildTools.jar with the parameter --rev <version>. After a short time (depends on your internet connection speed and computer hardware specs) the compiled spigot-<version>.jar will be found in the BuildTools directory.
    • Wait as it builds your jars. In a few minutes you should have freshly compiled jars!
    • You can find CraftBukkit (to but not including version 1.14) and Spigot in the same directory you ran the the BuildTools.jar in (craftbukkit-1.14.jar and spigot-1.14.jar). You can find Spigot-API in \Spigot\Spigot-API\target\ (spigot-api-1.14-R0.1-SNAPSHOT.jar). To compile CraftBukkit for 1.14 and beyond, you must add the --compile craftbukkit argument to the command.
    • Enjoy your new server!
      1. Need help getting started running the server? Look here: Getting Started


    Versions of spigot can be generated by using --rev and the version you are trying to get. Below are supported methods to use in BuildTools.
    Note that sometimes this wiki page is outdated, check the home page for info on the latest available builds!


    Code (Bash):
    java -jar BuildTools.jar --rev latest
    • Will build the latest STABLE Spigot jar (can remove --rev and will generate latest version)
    • Currently 1.16.4
    • Change Log: Check 1.16.4
    • Versions above this are NOT deemed as stable and should NOT be used on production servers


    Code (Bash):
    java -jar BuildTools.jar --rev 1.16.4
    • Will build a Spigot jar for 1.16.4
    • Change Log: Mojang | Stash | Jenkins


    Code (Bash):
    java -jar BuildTools.jar --rev 1.16.3


    Code (Bash):
    java -jar BuildTools.jar --rev 1.16.2


    Code (Bash):
    java -jar BuildTools.jar --rev 1.16.1


    Code (Bash):
    java -jar BuildTools.jar --rev 1.15.2


    Code (Bash):
    java -jar BuildTools.jar --rev 1.15.1


    Code (Bash):
    java -jar BuildTools.jar --rev 1.15
    • Will build a Spigot jar for 1.15
    • Change Log: Mojang | Stash | Jenkins


    Code (Bash):
    java -jar BuildTools.jar --rev 1.14.4
    • Will build a Spigot jar for 1.14.4
    • Change Log: Mojang | Stash | Jenkins


    Code (Bash):
    java -jar BuildTools.jar --rev 1.14.3
    • Will build a Spigot jar for 1.14.3
    • Change Log: Mojang | Stash | Jenkins


    Code (Bash):
    java -jar BuildTools.jar --rev 1.14.2
    • Will build a Spigot jar for 1.14.2
    • Change Log: Mojang | Stash | Jenkins


    Code (Bash):
    java -jar BuildTools.jar --rev 1.14.1
    • Will build a Spigot jar for 1.14.1
    • Change Log: Mojang | Stash | Jenkins


    Code (Bash):
    java -jar BuildTools.jar --rev 1.14
    • Will build a Spigot jar for 1.14
    • Change Log: Mojang | Stash | Jenkins


    Code (Bash):
    java -jar BuildTools.jar --rev 1.13.2
    • Will build a CraftBukkit and Spigot jar for 1.13.2
    • Change Log: Mojang | Stash | Jenkins


    Code (Bash):
    java -jar BuildTools.jar --rev 1.13.1
    • Will build a CraftBukkit and Spigot jar for 1.13.1
    • Change Log: Mojang | Stash | Jenkins


    Code (Bash):
    java -jar BuildTools.jar --rev 1.13
    • Will build a CraftBukkit and Spigot jar for 1.13
    • Change Log: Mojang | Stash | Jenkins


    Code (Bash):
    java -jar BuildTools.jar --rev 1.12.2
    • Will build a CraftBukkit and Spigot jar for 1.12.2
    • Change Log: Mojang | Stash | Jenkins


    Code (Bash):
    java -jar BuildTools.jar --rev 1.12.1
    • Will build a CraftBukkit and Spigot jar for 1.12.1
    • Change Log: Mojang | Stash | Jenkins


    Code (Bash):
    java -jar BuildTools.jar --rev 1.12
    • Will build a CraftBukkit and Spigot jar for 1.12
    • Change Log: Mojang | Stash | Jenkins


    Code (Bash):
    java -jar BuildTools.jar --rev 1.11
    • Will build a CraftBukkit and Spigot jar for 1.11
    • Change Log: Mojang | Stash | Jenkins


    Code (Bash):
    java -jar BuildTools.jar --rev 1.10.2
    • Will build a CraftBukkit and Spigot jar for 1.10.2
    • Change Log: Mojang | Stash | Jenkins


    Code (Bash):
    java -jar BuildTools.jar --rev 1.9.4
    • Will build a CraftBukkit and Spigot jar for 1.9.4
    • Change Log: Mojang | Stash | Jenkins


    Code (Bash):
    java -jar BuildTools.jar --rev 1.9.2


    Code (Bash):
    java -jar BuildTools.jar --rev 1.9
    • Will build a CraftBukkit and Spigot jar for 1.9
    • Change Log: Mojang | Stash | Jenkins


    Code (Bash):
    java -jar BuildTools.jar --rev 1.8.8
    • Will build a CraftBukkit and Spigot jar for 1.8.8
    • Change Log: Mojang | Stash | Jenkins


    Code (Bash):
    java -jar BuildTools.jar --rev 1.8.3


    Code (Bash):
    java -jar BuildTools.jar --rev 1.8
    • Will build a CraftBukkit and Spigot jar for 1.8
    • Change Log: Mojang | Stash | Jenkins

    Issues and Common Concerns(top)

    • There's an error regarding jacobe.exe or jacobe being missing from BuildData/bin
      • Update BuildTools.jar
    • Buildtools gives the error " BuildData/mappings/bukkit-1.8-cl.csrg"
      • Update to the latest BuildTools to fix this issue
    • Exception in thread "main" org.eclipse.jgit.api.errors.TransportException
      • BuildTools had trouble establishing a secure connection to the git repos, this is most likely due to your antivirus (Malwarebytes in particular) blocking the connection. Please whitelist in your AV program.
    • Spigot's says "/bin/bash^M: bad interpreter"
    • Spigot's says "line 2: $'\r': command not found"
      • This occurs on Linux (and occasionally Windows) when you have git's autocrlf enabled. To fix, run git config --global --unset core.autocrlf and re-pull/re-run BuildTools.
      • On Windows this may occur when using the built-in command prompt (cmd.exe). To fix this, change to a different terminal such as Git Bash.
    • Spigot's says "fatal: sha1 information is lacking or useless"
    • Spigot's says "Patch failed at ..."
      • This occurs on Windows if git's autocrlf is set to false (or unset). To fix, run git config --global --replace-all core.autocrlf true and re-pull/re-run BuildTools
      • If on linux, run git config --global --unset core.autocrlf and re-pull/re-run BuildTools.
    • Failed to create log file: BuildTools.log.txt
    • Exception in thread "main" org.eclipse.jgit.api.errors.JGitInternalException: Creating directories...
      • Ensure that you have write access to the directory you're running BuildTools in.
    • [ERROR] ... The import gnu.trove.... cannot be resolved
      • VIPRE antivirus has been known to cause this issue. It is possible that other antivirus software may also cause the same or similar issues. Disable the antivirus software and run BuildTools again.
      • If the issue persists after disabling the antivirus software, you may need to clear your local Maven repository by deleting the .m2 folder in your Windows user folder (Win+R and open %userprofile%), then perform a clean run of BuildTools (delete all of the files and folders it previously created before running it again).
    • (for Windows 10 users) fatal error in forked process - fork: can't reserve memory for parent stack
      • There is a known issue with the 64-bit version of Git on Windows 10 that causes this error. Uninstall the 64-bit version of Git, then download and install the 32-bit version and re-run BuildTools.
    • [ERROR] Exception in thread "main" org.eclipse.jgit.api.errors.JGitInternalException: Invalid ref origin/master specified
      This seems to happen at random. Delete all files created by BuildTools.jar and start over.
    • (for Mac OS X 10.11 El Capitan users) xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
      • El Capitan breaks Xcode installs if you've upgraded from a previous version of OS X. To fix this, run xcode-select --install and re-pull/re-run BuildTools.
    • Git bash for Windows won't let me select text
      • Right click the top left corner of git bash > properties > enable QuickEdit mode > OK
      • Left click drag to select, right click once to copy.
      • You can also right click once to paste.
    • Can I build this on a CI server?
    • the trustAnchors parameter must be non-empty
      • You are missing Java certificates on your server, or a firewall / antivirus is blocking your connection.
      • Install ca-certificates-java or run with the --disable-certificate-check argument.
    • error: Your local changes to the following files would be overwritten by merge
      • You might be running BuildTools in a folder that is synced by some external software, try a folder that is not synced.
      • It has been found that Windows 10 will automatically do some syncing on the Desktop folder, try to avoid using that and use a separate folder instead.

    Troubleshooting and Support(top)

    If you continue to have issues getting BuildTools to run, you can ask on IRC or check the Tickets to see if your issue already exists.

    To run BuildTools on Debian Stretch, you may need to use the following code:
    Code (Text):
    $ git config --global --unset core.autocrlf
    $ export _JAVA_OPTIONS=""
    $ java -jar BuildTools.jar
    Please note that it is recommended to move the compiled jar outside the BuildTools folder (to your server folder for example) to run your server. Not doing so could mess up buildtools folder in the future.


    There are several command line flags in BuildTools. You don't need to use any of them by default. All of them are listed below.


    Displays the console help. BuildTools will exit after.


    Disable HTTPS certificate check.


    BuildTools won't check for Java versions.


    BuildTools won't pull updates from Git.


    Skip compilation.


    Generates the source jar.
    NOTE: Sources only generated for Bukkit.


    Generates the JavaDoc jar.
    NOTE: JavaDoc only generated for Bukkit.


    Disables BuildTools version checking, Java version check, and MC version lookup.
    Just builds the actual build environment.


    Final jar output directory.
    Requires a file path argument to an existing directory.
    Defaults to the directory where the BuildTools.jar is.


    The version to build.
    Requires a version argument.
    Defaults to the latest available version.

    --compile craftbukkit(top)

    Build CraftBukkit.
    As BuildTools will not build CraftBukkit by default, this makes BuildTools build CraftBukkit.


    Only compile if changes were detected in the BuildTools repositories.
    This is useful for projects that require NMS dependencies on a build server.
  • Loading...
  • Loading...