Android build error due to incorrect java version

android, build, java

Solution

Open jdk is not supported for android build. Try using sun jdk instead. You can install sun jdk by these commands:

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:

add-apt-repository ppa:ferramroberto/java
apt-get update
apt-get install sun-java6-jdk

Problem

I am currently trying to build Android just for learning purpose. But I am facing strange error - 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. my java - version gives me 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) any Idea what went wrong? regards,

Original source