This is a quick tip on how to setup Ubuntu to build Android from scrap.

Android / Gingerbread build process itself is pretty straightforward if you follow the standard documentation:

What will stop you is that Ubuntu has, in my opinion, two things that annoy every java developer:
a) openjdk / fastjar
b) pulseaudio! Neah, this just annoys everybody :))

This crippled Java kills Gingerbread build process with errors like:

For all the details and the solution here’s how to fix:

Correcting the fastjar mess :

and selecting the proper Sun / Oracle JDK fastjar alternative.

It now builds correctly in just under one hour! (E8500 / 2Gb DDRAM 800Mhz / RAID-0).

So, to get rid of OpenJDK/fastjar, issue the following commands:

as well as:

It will actually remove much more (as there are many dependencies not used), but this does not affect the build process of Gingerbread as long as you have Sun’s JDK installed.

Make sure you check the output and you don’t delete something you need.