I am currently trying to build Android just for learning purpose. But I am facing strange error -
我目前正在尝试构建Android,只是为了学习。但是我面临着奇怪的错误
You are attempting to build with the incorrect version of java. Your version is: java version "1.7.0_07". The correct version is: Java SE 1.6.
您正在尝试使用不正确的java版本构建。您的版本是:java版本“1.7.0_07”。正确的版本是:Java SE 1.6。
my java - version gives me
我的java版本给了我
java version "1.7.0_07" Java(TM) SE Runtime Environment (build 1.7.0_07-b10) Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)
java版本“1.7.0_07”java (TM) SE运行时环境(构建1.7.0_07-b10) java HotSpot(TM) 64位服务器VM(构建23.3-b01,混合模式)
any Idea what went wrong? regards,
你知道哪里出错了吗?问候,
5 个解决方案
#1
1
Open jdk is not supported for android build. Try using sun jdk instead. You can install sun jdk by these commands:
开放jdk不支持android构建。尝试使用sun jdk代替。您可以通过以下命令安装sun jdk:
add-apt-repository "deb http://archive.canonical.com/ lucid partner"
apt-get update
apt-get install sun-java6-jdk
If the above command does not work(fails to download jdk), use the following commands instead:
如果上面的命令不起作用(下载jdk失败),则使用以下命令:
add-apt-repository ppa:ferramroberto/java
apt-get update
apt-get install sun-java6-jdk
#2
17
1.) If you’ve already installed OpenJDK . Remove it by running this command: sudo apt-get purge openjdk*
1)。如果您已经安装了OpenJDK。通过运行这个命令删除它:sudo apt-get清除openjdk*。
2.) Then:
2)。然后:
sudo add-apt-repository ppa:webupd8team/java
Then update:
然后更新:
sudo apt-get update
3.) Select which version you want To install Oracle Java 8:
3)。选择要安装Oracle Java 8的版本:
sudo apt-get install oracle-java8-installer
To install Oracle Java 7:
安装Oracle Java 7:
sudo apt-get install oracle-java7-installer
To install the Java 6:
要安装Java 6:
sudo apt-get install oracle-java6-installer
#3
4
After upgrade Ubuntu 12.04 to 12.10 - just export path before build Android e.g:
在升级Ubuntu 12.04到12.10之后-在构建Android之前导出路径
export PATH=/usr/lib/jvm/java-6-openjdk-amd64/bin/:$PATH
导出路径= / usr / lib / jvm / java-6-openjdk-amd64 / bin /:$路径
#4
1
In Eclipse.. Goto Window -> Preferences.. from there Expand the "Java" group. Click "Compiler". From there set the compiler compliance level to 1.6 and all other settings (if not already set to use the default compliance level) to 1.6
在Eclipse中. .转到窗口- >首选项. .从那里展开“Java”组。点击“编译器”。从那里,将编译器的遵从性级别设置为1.6,所有其他设置(如果还没有设置为默认的遵从级别)为1.6。
#5
0
Exactly what the message says... Android requires Java 1.5 or 1.6... You are using 1.7
确切地说,消息说……Android需要Java 1.5或1.6……您使用的是1.7
Install and use Java 1.5 or 1.6.
安装并使用Java 1.5或1.6。
#1
1
Open jdk is not supported for android build. Try using sun jdk instead. You can install sun jdk by these commands:
开放jdk不支持android构建。尝试使用sun jdk代替。您可以通过以下命令安装sun jdk:
add-apt-repository "deb http://archive.canonical.com/ lucid partner"
apt-get update
apt-get install sun-java6-jdk
If the above command does not work(fails to download jdk), use the following commands instead:
如果上面的命令不起作用(下载jdk失败),则使用以下命令:
add-apt-repository ppa:ferramroberto/java
apt-get update
apt-get install sun-java6-jdk
#2
17
1.) If you’ve already installed OpenJDK . Remove it by running this command: sudo apt-get purge openjdk*
1)。如果您已经安装了OpenJDK。通过运行这个命令删除它:sudo apt-get清除openjdk*。
2.) Then:
2)。然后:
sudo add-apt-repository ppa:webupd8team/java
Then update:
然后更新:
sudo apt-get update
3.) Select which version you want To install Oracle Java 8:
3)。选择要安装Oracle Java 8的版本:
sudo apt-get install oracle-java8-installer
To install Oracle Java 7:
安装Oracle Java 7:
sudo apt-get install oracle-java7-installer
To install the Java 6:
要安装Java 6:
sudo apt-get install oracle-java6-installer
#3
4
After upgrade Ubuntu 12.04 to 12.10 - just export path before build Android e.g:
在升级Ubuntu 12.04到12.10之后-在构建Android之前导出路径
export PATH=/usr/lib/jvm/java-6-openjdk-amd64/bin/:$PATH
导出路径= / usr / lib / jvm / java-6-openjdk-amd64 / bin /:$路径
#4
1
In Eclipse.. Goto Window -> Preferences.. from there Expand the "Java" group. Click "Compiler". From there set the compiler compliance level to 1.6 and all other settings (if not already set to use the default compliance level) to 1.6
在Eclipse中. .转到窗口- >首选项. .从那里展开“Java”组。点击“编译器”。从那里,将编译器的遵从性级别设置为1.6,所有其他设置(如果还没有设置为默认的遵从级别)为1.6。
#5
0
Exactly what the message says... Android requires Java 1.5 or 1.6... You are using 1.7
确切地说,消息说……Android需要Java 1.5或1.6……您使用的是1.7
Install and use Java 1.5 or 1.6.
安装并使用Java 1.5或1.6。