If you have the latest Ubuntu 9.10 Karmic Koala and tried to build the Android Open Source Project you have discovered that your system lacks the necessary Java 5 to complete the build. Ubuntu 9.10 now includes Java 6 and has removed the now obsolete Java 5 from its repository. Unfortunately Android still requires this older version and is incompatible with the latest one.
You can find the official build instructions here:
These instructions mention this issue but don’t provide any solutions. Fortunately the fix is easy as you can use the 9.04 Intrepid repository to install Java 5.
Start by adding the following line to /etc/apt/sources.list.
deb http://us.archive.ubuntu.com/ubuntu/ jaunty multiverse
Now update the your package info.
sudo apt-get update
Install the Java 5 package.
$ sudo apt-get install sun-java5-jdk
Finally update the system to be able to use the new version of Java.
$ sudo update-java-alternatives -s java-1.5.0-sun
And thats it. Hopefully in the near future they can get it to build with Java 6, but from here on you should be able to follow the official instructions and successfully build the Android Open Source Project.