Bazel installation under ubuntu system

官方Doc:https://docs.bazel.build/versions/master/install-ubuntu.html

Custom APT repository using Bazel (recommended)

1. Install JDK 8

Install JDK 8 using the following command:

sudo apt-get install openjdk-8-jdk

On Ubuntu 14.04 LTS you may need to use the PPA:

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update && sudo apt-get install oracle-java8-installer

2. Add Bazel distribution URI as package source (one time setup)

Enter the following command

echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add -

If you want to install the testing version of Bazel, replace stable with testing.

3. Install and update Bazel

sudo apt-get update && sudo apt-get install bazel

Once installed, you can upgrade to a newer version of Bazel:

sudo apt-get upgrade bazel

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325650996&siteId=291194637