gpt4 book ai didi

java - Ubuntu 15.04 构建Android 5.0 错误: You are attempting to build with the incorrect version of java. 为什么?

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:43:38 31 4
gpt4 key购买 nike

错误:

============================================
Checking build tools versions...
************************************************************
You are attempting to build with the incorrect version
of java.

Your version is: Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar java version "1.7.0_80" Java(TM) SE Runtime Environment (build 1.7.0_80-b15) Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode).
The required version is: "1.7.x"

Please follow the machine setup instructions at
https://source.android.com/source/initializing.html
************************************************************
build/core/main.mk:174: *** stop. Stop.

#### make failed to build some targets (1 seconds) ####

java 版本:

$ java -version
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar
java version "1.7.0_80"
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)

javac -版本:

$ javac -version
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar
javac 1.7.0_80


$ sudo update-alternatives --config java
There are 2 choices for the alternative java (providing /usr/bin/java).

Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java 1071 auto mode
1 /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java 1071 manual mode
* 2 /usr/lib/jvm/java-7-oracle/jre/bin/java 1 manual mode

$ sudo update-alternatives --config javac
There are 2 choices for the alternative javac (providing /usr/bin/javac).

Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/jvm/java-7-openjdk-amd64/bin/javac 1071 auto mode
1 /usr/lib/jvm/java-7-openjdk-amd64/bin/javac 1071 manual mode
* 2 /usr/lib/jvm/java-7-oracle/bin/javac 1 manual mode

最佳答案

对于那些想通过 KitKat(需要 Oracle JDK 1.6)构建 Gingerbread 但已经为 Lollipop (JDK 1.7) 配置系统的人,这是更新系统的最简单方法:

首先为更新的 Java 构建添加 PPA。

sudo add-apt-repository ppa:webupd8team/java

然后安装:

sudo apt-get update && sudo apt-get install oracle-java6-installer

完成后,您只需告诉 Linux 使用旧版本的 Java 和 Java 编译器来呈现内容。

分别运行以下两个命令,在出现提示时两次都为 Oracle JDK 1.6 做出正确选择。再次在终端中:

sudo update-alternatives --config java
sudo update-alternatives --config javac

关于java - Ubuntu 15.04 构建Android 5.0 错误: You are attempting to build with the incorrect version of java. 为什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31486348/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com