BuildTools

Jun 18, 2016
BuildTools
  • 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.

    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, if you want a one-click approach, click here (the "Tools" section).

    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.
    Java - Download JRE 8 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-7-jre-headless tar
    CentOS/RHEL: sudo dnf install git java-1.7.0-openjdk-devel tar
    Arch: pacman -S jdk8-openjdk git

    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

    Running BuildTools(top)

    1. Download BuildTools.jar from https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar.
      1. Keep watch on https://hub.spigotmc.org/jenkins/job/BuildTools 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. Script was moved here due to more automation in the install process:
        https://www.spigotmc.org/wiki/buildtools-updater/
      2. All the details are inside this script, and is all set, all you have to set is how the script will function.
    6. Wait as it builds your jars. In a few minutes you should have freshly compiled jars!
    7. You can find CraftBukkit and Spigot in the same directory you ran the the BuildTools.jar in (craftbukkit-1.10.jar and spigot-1.10.jar). You can find Spigot-API in \Spigot\Spigot-API\target\ (spigot-api-1.10-R0.1-SNAPSHOT.jar).
    8. Enjoy your new server!
      1. Need help getting started running the server? Look here: Getting Started
      2. Want an Updater script without going into a browser? Look here: BuildTools Updater

    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.

    Latest(top)

    • Code (Latest Version):
      java -jar BuildTools.jar --rev latest
      • Will build the latest stable CraftBukkit and Spigot jar (can remove --rev and will generate latest version)
      • Currently 1.10
      • Change Log: Check 1.10

    1.10(top)

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

    1.9.4(top)

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

    1.9.2(top)

    • Code (Version 1.9.2):
      java -jar BuildTools.jar --rev 1.9.2

    1.9(top)

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

    1.8.8(top)

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

    1.8.7(top)

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

    1.8.3(top)

    • Code (Version 1.8.3):
      java -jar BuildTools.jar --rev 1.8.3

    1.8(top)

    • Code (Version 1.8):
      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 "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.
    • 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.
    • 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?
    • 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.

    Tools(top)

    These tools below are created by the following community members, and should not be modified without the consent from the creator.

    BuildToolsGUI by DemonWav(top)

    BuildToolsGUI is a user interface wrapper for BuildTools for Windows. It is compatible with Windows 7, 8, 8.1, and 10. It handles all of the dependencies to run BuildTools automatically. To use BuildToolsGUI you need to have .NET 4.5 installed on your Windows computer. If you have used your computer for a while, you probably already have it. If not, click here to install it.

    BuildToolsGUI will automatically check for updates every time you run it. You can download it and find updates here. The source code to BuildToolsGUI can be viewed here.

    ShellBT by Byteflux and __0x277F(top)

    Wanting to get started contributing to Spigot? Want to look through the Minecraft source? Well, this is a shell-script alternative to BuildTools. Simply clone this repo and execute ./build.sh! It's that easy! All credit for the scripts goes to Byteflux, I (__0x277F) just modified it a bit.

    BuildTools Updater by Legoman99573(top)

    A windows batch script for updating BuildTools automatically. You can read the wiki on it here. You can find beta builds here. These beta builds could sometimes not be tested/finished, and/or may possibly break the script, and possibly Git. Legoman is not responsible for broken programs during beta stage. Use beta builds at your own risk.

    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.

    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.
  • Loading...
  • Loading...