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: http://source.android.com/source/building.html.

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: https://groups.google.com/group/pandaboard/browse_thread/thread/2ad9f0ae099e7db1?fwc=1&pli=1

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.