Ensure that you have OpenJDK 8 installed on your system. For a system based on debian packages (e.g. Debian, Ubuntu), install OpenJDK 8 by running the command sudo apt-get install openjdk-8-jdk
.
The standard way of compiling a release version of Bazel from source is to use a distribution archive. Download bazel-<VERSION>-dist.zip
from the release page for the desired version. We recommend to also verify the signature made by our release key 48457EE0. The distribution archive also contains generated files in addition to the versioned sources, so this step cannot be short cut by using a checkout of the source tree.
Unzip the archive and call bash ./compile.sh
; this will create a bazel binary in output/bazel
. This binary is self-contained, so it can be copied to a directory on the PATH (such as /usr/local/bin
) or used in-place.
Windows support is in beta. Known issues are marked with label “Windows” on github issues.
Prerequisites:
To build Bazel on Windows:
compile.sh
in Bazel directory.output\bazel.exe
.