How to install JDK 1.6 on Ubuntu in order to compile Android System

Unfortunately there is not a java 1.6 package available on Ubuntu repository, but fortunately we have an alternative:

$ git clone
$ cd oab-java6
$ sudo ./

If compilation finished correctly just execute it:

$ sudo apt-get install sun-java6-jdk

Case you have other java packages installed, execute it:

$ sudo update-alternatives --config java

and choose number related to /usr/lib/jvm/java-6-sun/jre/bin/java and repeat this process to javac.

Thanks Vinicius Tinti for this tip.