ubuntu android8.0 openJDK8 源码编译

错误如下:

ninja: no work to do.
[1/1] out/soong/.bootstrap/bin/soong_build out/soong/build.ninja
10:35:50 *******************************************************
10:35:50 You are attempting to build with an unsupported JDK.
10:35:50 
10:35:50 Only an OpenJDK based JDK is supported.
10:35:50 
10:35:50 Please follow the machine setup instructions at:
10:35:50     https://source.android.com/source/initializing.html
10:35:50 *******************************************************
10:35:50 stop

通过错误可以知道需要openJDK才行,可以猜测我当前用户环境变量中的JDK是Oracle 版本,

oracle:

$ java -version
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)

openjdk:

# java -version
openjdk version "1.8.0_222-ea"
OpenJDK Runtime Environment (build 1.8.0_222-ea-8u222-b05-1~12.04.1-b05)
OpenJDK 64-Bit Server VM (build 25.222-b05, mixed mode)

于是我们通过如下命令安装openjdk1.8:

aptitude install openjdk-8-jdk

这里我们使用的安装命令是:aptitude ,这个命令会对所需安装的包的依赖进行处理,更加方便快捷。

你可能感兴趣的:(linux,Android系统)