How to Install Bazel on macOS

Overview

Bazel is a free, open-source build system that is designed to handle large, complex projects. It can be used to build a variety of languages including Java, C++, and Python among others. This tutorial will guide you through the process of installing Bazel on macOS.

Prerequisites

Before you proceed, ensure that you have the following installed on your macOS:

Steps

  1. Open Terminal or your Command Line Interface.
  2. Install Xcode Developer Tools by running the following command:
xcode-select --install
  1. Install Homebrew if you have not yet done so, via the following command:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
  1. Once Homebrew is installed, update it by running the following command:
brew update
  1. Install the required dependencies by running:
brew install python@3.9
brew install openjdk@11
  1. Add the OpenJDK version 11 to your PATH by running the following command:
echo 'export PATH="/usr/local/opt/openjdk@11/bin:$PATH"' >> ~/.zshrc
  1. Reload the terminal by executing:
source ~/.zshrc
  1. Verify that the latest Python 3 has been installed on your system by running:
python3 --version
  1. Install Bazel by running the following command:
brew install bazel
  1. To confirm that Bazel has been installed, check the version of Bazel by running:
bazel version

Conclusion

You have now successfully installed Bazel on your macOS. You can now begin to use Bazel to build your projects.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!