(According to official setup notes: Java 6 is not supported, because of incompatibilities with @Override.) The default JDK choose by Maverick was icedtea6, which is not recommended for building android, so, we're gonna install JDK5 instead of icedtea.
Unfortunately, JDK5 was abandoned by Ubuntu 10.10/10.04, but fortunately, Janty(9.04) still have JDK5 in its repository. So, let's move on.
Add packages sources to /etc/apt/sources.list:
deb http://archive.ubuntu.com/ubuntu dapper main multiverse
deb http://archive.ubuntu.com/ubuntu dapper-updates main multiverseand then:
$sudo apt-get update
$sudo apt-get install sun-java5-jdkafter installation finished, use
$java -versionto check the current java version.
$update-java-alternatives -l$sudo update-java-alternatives -s java-1.5.0-sun