指定编译环境为openjdk而不是javajdk

2019-09-30  本文已影响0人  Ed_Lannister

解决:You asked for an OpenJDK based build but your version is java version "1.8.0_131" Java(TM) SE Run

本文链接:https://blog.csdn.net/yang_quan_yang/article/details/80340814

原因是:编译Android的源码时要安装 openjdk而不是jdk

1.下载openjdk

*sudo apt-get install openjdk-8-jdk*

2.环境变量设置
1.sudo vim /etc/environment

*PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:$JAVA_HOME/bin"* 
*export CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib* 
*export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64*

2.sudo vim /etc/profile

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export JRE_HOME=$JAVA_HOME/jre  
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH 
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH* 

3. source /etc/environment /etc/profile

上一篇 下一篇

猜你喜欢

热点阅读