- What is it?
- Running BuildTools
- Issues and Common Concerns
- Troubleshooting and Support
- --compile craftbukkit
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.
Prerequisites(top)There are two applications necessary to use BuildTools: Git and Java.
Windows(top)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 - Below Minecraft 1.17: - Download JRE 8 from here and install. Just keep hitting next when running the installer.
Java - Minecraft 1.17[.1]: - Download OpenJDK 16 from here and install. Just keep hitting next when running the installer.
Java - Above Minecraft 1.17.1: - Download OpenJDK 17 from here and install. Just keep hitting next when running the installer.
Linux(top)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
Minecraft 1.17[.1]: You need to install at least OpenJDK 16. You can do this either by adjusting the commands above (if supported by your distro) or by downloading a third-party distribution here.
Above Minecraft 1.17.1: You need to install at least OpenJDK 17. You can do this either by adjusting the commands above (if supported by your distro) or by downloading a third-party distribution here.
Mac(top)Git can be downloaded from: http://sourceforge.net/projects/git-osx-installer/files/
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: https://gist.github.com/johan/10590467
Minecraft 1.17[.1]: Download OpenJDK 16 or higher from here and install.
Above Minecraft 1.17.1: Download OpenJDK 17 or higher from here and install.
- Download BuildTools.jar from https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar.
- Keep watch on https://hub.spigotmc.org/jenkins/job/BuildTools for any bug fixes and updates
- 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.
- Spaces or exclamation points in the directory path may break BuildTools! It is recommended to remove these.
- Open your terminal if you are on Linux, or git bash on Windows.
- 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.
- Navigate to where you downloaded BuildTools.jar, or use the command line way to download the jar to your current directory.
- 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.
- Run BuildTools.jar from the terminal (Do not double-click BuildTools.jar) by doing the following:
- On Linux run git config --global --unset core.autocrlf, then run java -jar BuildTools.jar in bash or another appropriate shell.
- On Windows run the below command inside the git bash window that opened:
- java -jar BuildTools.jar
- Please be aware that it is required that you have BuildTools #35 or later, older versions will not work.
- On Mac run the below commands,
- export MAVEN_OPTS="-Xmx2G"
java -Xmx2G -jar BuildTools.jar
- export MAVEN_OPTS="-Xmx2G"
- 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
- (Optional) on Windows create a batch (.bat) file using this code to automate the install process:
Code (Text):@echo off
IF NOT EXIST BuildTools (
curl -z BuildTools.jar -o BuildTools.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar
set /p Input=Enter the version: || set Input=latest
java -jar BuildTools.jar --rev %Input%
- 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!
- Need help getting started running the server? Look here: Getting Started
Versions(top)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!
java -jar BuildTools.jar --rev latest
- Will build the latest STABLE Spigot jar (can remove --rev and will generate latest version)
- Currently 1.18.2
- Change Log: Check 1.18.2
- Versions above this are NOT deemed as stable and should NOT be used on production servers
java -jar BuildTools.jar --rev 1.18.2
java -jar BuildTools.jar --rev 1.18.1
java -jar BuildTools.jar --rev 1.18
java -jar BuildTools.jar --rev 1.17.1
java -jar BuildTools.jar --rev 1.17
java -jar BuildTools.jar --rev 1.16.5
java -jar BuildTools.jar --rev 1.16.4
java -jar BuildTools.jar --rev 1.16.3
java -jar BuildTools.jar --rev 1.16.2
java -jar BuildTools.jar --rev 1.16.1
java -jar BuildTools.jar --rev 1.15.2
java -jar BuildTools.jar --rev 1.15.1
java -jar BuildTools.jar --rev 1.15
java -jar BuildTools.jar --rev 1.14.4
java -jar BuildTools.jar --rev 1.14.3
java -jar BuildTools.jar --rev 1.14.2
java -jar BuildTools.jar --rev 1.14.1
java -jar BuildTools.jar --rev 1.14
java -jar BuildTools.jar --rev 1.13.2
java -jar BuildTools.jar --rev 1.13.1
java -jar BuildTools.jar --rev 1.13
java -jar BuildTools.jar --rev 1.12.2
java -jar BuildTools.jar --rev 1.12.1
java -jar BuildTools.jar --rev 1.12
java -jar BuildTools.jar --rev 1.11.2
java -jar BuildTools.jar --rev 1.11.1
java -jar BuildTools.jar --rev 1.11
java -jar BuildTools.jar --rev 1.10.2
java -jar BuildTools.jar --rev 1.9.4
java -jar BuildTools.jar --rev 1.9.2
java -jar BuildTools.jar --rev 1.9
java -jar BuildTools.jar --rev 1.8.8
java -jar BuildTools.jar --rev 1.8.3
java -jar BuildTools.jar --rev 1.8
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 "java.io.FileNotFoundException: 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 https://hub.spigotmc.org in your AV program.
- Spigot's applyPatches.sh says "/bin/bash^M: bad interpreter"
- Spigot's applyPatches.sh 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 applyPatches.sh says "fatal: sha1 information is lacking or useless"
- Spigot's applyPatches.sh 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.
- java.lang.RuntimeException: Error running command, return status !=0
- If you are on Linux, please set the environment variable: SHELL to /usr/bin/bash by executing this command before running BuildTools: export set SHELL="/usr/bin/bash". It occurs when you are not using bash as default shell.
- 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?
- Yes, CI servers that are capable of running simple bash commands can build these jars. Run the following command:
- wget https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar -O BuildTools.jar && java -jar BuildTools.jar
- Keep in mind to that these builds should be for private use only and should not be publicly distributed or accessible.
- java.security.InvalidAlgorithmParameterException: 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.
- org.eclipse.jgit.errors.RepositoryNotFoundException: repository not found
- BuildTools was aborted while running previously. Delete the other files in the folder and run Buildtools again.
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:
$ git config --global --unset core.autocrlf
$ export _JAVA_OPTIONS="-Djavax.net.ssl.trustStorePassword=changeit"
$ java -jar BuildTools.jar
$ export _JAVA_OPTIONS="-Djavax.net.ssl.trustStorePassword=changeit"
$ java -jar BuildTools.jar
Flags(top)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.
--help(top)Displays the console help. BuildTools will exit after.
--disable-certificate-check(top)Disable HTTPS certificate check.
--disable-java-check(top)BuildTools won't check for Java versions.
--dont-update(top)BuildTools won't pull updates from Git.
--generate-source(top)Generates the source jar.
NOTE: Sources only generated for Bukkit.
--generate-docs(top)Generates the JavaDoc jar.
NOTE: JavaDoc only generated for Bukkit.
--dev(top)Disables BuildTools version checking, Java version check, and MC version lookup.
Just builds the actual build environment.
--output-dir(top)Final jar output directory.
Requires a file path argument to an existing directory.
Defaults to the directory where the BuildTools.jar is.
--rev(top)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.
--compile-if-changed(top)Only compile if changes were detected in the BuildTools repositories.
This is useful for projects that require NMS dependencies on a build server.