<commit_before>---
layout: documentation
title: Compiling Bazel from Source
---

# <a name="compiling-from-source"></a>Compiling Bazel from Source (bootstrapping)

You can build Bazel from source without using an existing Bazel binary.

### 1.  Install the prerequisites

#### Unix-like systems

Ensure you have installed:

*   **Bash**

*   **zip, unzip**

*   **C++ build toolchain**

*   **JDK 8.** You must install version 8 of the JDK. Versions other than 8 are
    *not* supported.

*   **Python**. Versions 2 and 3 are supported.

For example on Ubuntu Linux you can install these requirements using the following command:

```sh
sudo apt-get install build-essential openjdk-8-jdk python zip unzip
```

#### Windows

Ensure you have installed:

*   [MSYS2 shell](https://msys2.github.io/)

*   **The required MSYS2 packages.** Run the following command in the MSYS2
    shell:
    ```sh
    pacman -Syu zip unzip
    ```

*   **The Visual C++ compiler.** Install the Visual C++ compiler either as part
    of Visual Studio 2015 or newer, or by installing the latest [Build Tools
    for Visual Studio 2017](https://aka.ms/BuildTools).

*   **JDK 8.** You must install version 8 of the JDK. Versions other than 8 are
    *not* supported.<commit_msg>docs, website: remove bad `sh` from command<commit_after>---
layout: documentation
title: Compiling Bazel from Source
---

# <a name="compiling-from-source"></a>Compiling Bazel from Source (bootstrapping)

You can build Bazel from source without using an existing Bazel binary.

### 1.  Install the prerequisites

#### Unix-like systems

Ensure you have installed:

*   **Bash**

*   **zip, unzip**

*   **C++ build toolchain**

*   **JDK 8.** You must install version 8 of the JDK. Versions other than 8 are
    *not* supported.

*   **Python**. Versions 2 and 3 are supported.

For example on Ubuntu Linux you can install these requirements using the following command:

```sh
sudo apt-get install build-essential openjdk-8-jdk python zip unzip
```

#### Windows

Ensure you have installed:

*   [MSYS2 shell](https://msys2.github.io/)

*   **The required MSYS2 packages.** Run the following command in the MSYS2
    shell:

    ```
    pacman -Syu zip unzip
    ```

*   **The Visual C++ compiler.** Install the Visual C++ compiler either as part
    of Visual Studio 2015 or newer, or by installing the latest [Build Tools
    for Visual Studio 2017](https://aka.ms/BuildTools).

*   **JDK 8.** You must install version 8 of the JDK. Versions other than 8 are
    *not* supported.
{'fraction_non_alphanumeric': 0.11343048444269398, 'fraction_numerical': 0.01732965734541158, 'mean_word_length': 3.471830985915493, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3934689', 'n_tokens_mistral': 830, 'n_tokens_neox': 764, 'n_words': 322}