- Original link:
- https://www.cnblogs.com/jackchen-Net/p/7156763.html
- 1. Install JDK 8
- 2. Add Bazel distribution URI as package source (one time setup)
- 3. Install and update Bazel
官方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