How to Install Bazel on Windows 10

Bazel is a powerful and open-source build system developed at Google. It is designed to build software projects in a fast and efficient manner. This tutorial will guide you through the process of installing Bazel on Windows 10.

Step 1 - Install Java Development Kit (JDK)

As Bazel requires JDK 8 or later, you need to make sure that you have installed JDK on your machine. If you haven't installed yet, follow the below steps to install JDK:

  1. Go to the Java SE Development Kit 8 Downloads page.
  2. Download the Java SE Development Kit 8u261 for Windows x64. (Note: If your system architecture is different, download the relevant package.)
  3. Open the downloaded JDK executable file (e.g., jdk-8u261-windows-x64.exe)
  4. Follow the installation instructions on the wizard.

Step 2 - Download and extract Bazel package

  1. Go to the Bazel Releases page.
  2. Download the latest version of Bazel for Windows.
  3. Extract the downloaded package into a directory of your choice. (e.g., C:\Program Files\Bazel)

Step 3 - Add Bazel to Environment Variable

To use Bazel from any directory in Windows, you need to add the bazel executable to the system's PATH environment variable. To do so:

  1. Right-click the Start menu button, and select "System".
  2. Click on "Advanced system settings" in the left pane.
  3. In the System Properties window that opens, click on the "Environment Variables" button at the bottom.
  4. Under "System Variables", scroll down and find the PATH variable. Click on "Edit".
  5. Click on "New" at the end of the "Variable value" field.
  6. Type in the full path of the bin directory where the Bazel executable file resides. (e.g., C:\Program Files\Bazel\bin)
  7. Click "OK", "OK", and "OK" to close all the windows.

Step 4 - Test Bazel Installation

To verify that Bazel is installed correctly, open a command prompt and run the following command:

bazel version

If Bazel is installed and configured correctly, the output will be similar to the following:

bazel 2.2.0
...

Congratulations! You have successfully installed Bazel on Windows 10. You may start building software projects with Bazel from now on.

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!