I have tried a few answers, namely:

How to install tar.gz files? Installing tar.gz file which has no configure, install, and readme file How to install tar file (jhead) on Mac or Linux machine

I am trying to install a specific version of bazel via http://www.bazel.io/docs/install.html#mac-os-x, but using the tar.gz file within the 0.2.2b section of https://github.com/bazelbuild/bazel/releases.

The readme file links to the docs in the Github which are not specific about installing tar.gz files and ensuring your $PATH is updated. I was surprised to see not very clear instructions in general on this for the web.

I unzipped the file and see:

enter image description here

How can I go about this process and get myself up and running with 0.2.2b version of bazel? Homebrew would have been easier but it doesn't allow for older versions of bazel.

  • You have in root of archive script, named compile.sh Have you try it? Aug 2, 2016 at 13:41
  • Yes this seems to do something, and my command line prints the following after running sh compile.sh: -e INFO: You can skip this first step by providing a path to the bazel binary as second argument: -e INFO: compile.sh compile /path/to/bazel -e -n 🍃 Building Bazel from scratch. What is the "path to the bazel binary"? Where I want bazel to be installed? If so what parameters do I need to set so Install Bazel to the $HOME/bin directory on your system and set the .bazelrc path to $HOME/.bazelrc.. Aug 2, 2016 at 13:46
  • or, is the path to the bazel binary just the path to the unzipped folder I am in? Aug 2, 2016 at 13:46

1 Answer 1


The tar.gz file contains the uncompiled source code. The documentation states, to compile the code you should invoke ./compile.sh.

However, you can also simply use the pre-compiled installer-darwin*.sh at:


The documentation suggested that you will need to install Oracle's Java 8 Development Kit (http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) and XCode (https://developer.apple.com/xcode/downloads/).

Once the requirements are installed, you can install bazel via command line:

bash /path/to/bazel-0.2.2b-installer-darwin-x86_64.sh --user
  • 1
    That's nice put
    – sjsam
    Aug 2, 2016 at 14:01
  • I didn't know you could install Darwin.sh files on a Mac OS, thanks. Aug 2, 2016 at 15:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .