0

I am trying to compile Android for Ubuntu 10.04 32 bit system. I am following the guide on http://source.android.com/source/initializing.html

But I get the following error:

You are attempting to build with the incorrect version of java.

Your version is: java version "1.6.0_20". The correct version is: Java SE 1.6.

Guess, ubuntu support for Java SE packages has been halted. Therefore should I now downgrade my Java JDK to 1.6?? Please help

user489152
  • 907
  • 1
  • 23
  • 42
  • Check this below link to install sun jdk http://superuser.com/questions/394770/installing-sun-java6-jdk-with-apt-get-on-ubuntu-10-04 –  Jun 10 '12 at 10:33

2 Answers2

3

Here someone faced the very same problem as yours. The solution, "after uninstalling OpenJDK and Sun Java, I reinstalled Sun Java 6 JDK by itself, rebooted, and all is well." Check the link for more informations. While searching for that, I also stumbled upon an issue with 64 bits, that is not your point, but may be useful for someone else.

Eduardo
  • 4,282
  • 2
  • 49
  • 63
0

maybe you should use "sun jdk", not OpenJDK. the version should be 1.6.

Joe Ho
  • 918
  • 3
  • 13
  • 28
  • Hmm. I do have OpenJDK. I did java -version and here is what I get: java version "1.6.0_20" OpenJDK Runtime Environment (IcedTea6 1.9.9) (6b20-1.9.9-0ubuntu1~10.10.2) OpenJDK Server VM (build 19.0-b09, mixed mode) – user489152 Apr 12 '12 at 12:31
  • I downloaded jdk-6u31-linux-i586.bin from sun Java website. I added the generated jdk1.6.0_31 folder in my /usr/local/ and changed the JAVA_HOME and added it to PATH variable. However even after a reboot I get the same line as above when I type java -version. Should I remove OpenJDK? – user489152 Apr 12 '12 at 12:33