ubuntu18.04安装bazel
时间: 2023-11-14 13:09:17 浏览: 145
好的,以下是在Ubuntu 18.04上安装Bazel的步骤:
1. 安装Java JDK
```
sudo apt-get update
sudo apt-get install openjdk-8-jdk
```
2. 添加Bazel源
```
sudo apt-get install curl gnupg
curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > bazel.gpg
sudo mv bazel.gpg /etc/apt/trusted.gpg.d/
echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
```
3. 安装Bazel
```
sudo apt-get update && sudo apt-get install bazel
```
安装完成后,您可以通过运行以下命令来验证Bazel是否已正确安装:
```
bazel version
```
如果一切正常,您应该会看到类似于以下内容的输出:
```
Bazelisk version: v1.7.4
Build label: 3.7.2
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Fri Jul 23 19:45:33 2021 (1627080333)
Build timestamp: 1627080333
Build timestamp as int: 1627080333
```
阅读全文