Android Kitkat 4.4.4 Compile on Ubuntu 14.04

Short manual how to prepare Linux Ubuntu 14.04 environment to be able to compile Android Kitkat 4.4.4


The tutorial is dedicated to Linux users

As an example The BeagleBoneBlack Android build instruction taken from

Host Machine Hardware Configuration

100GByte free diskspace

8 or better 16 GByte of Ram

At least 4 thread CPU (performance reason)

1. Create directory for Android build purpose

mkdir a4b_4.4.4

2. Go to created folder

cd a4b_4.4.4

3. Java preparation

download java from

When download complete perform a following steps

chmod +x jdk-6u45-linux-x64.bin


sudo mkdir /usr/lib/jvm

sudo mv jdk1.6.0_45 /usr/lib/jvm/

sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_45/bin/javac 1
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_45/bin/java 1
sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.6.0_45/bin/javaws 1

sudo update-alternatives --config javac
sudo update-alternatives --config java
sudo update-alternatives --config javaws

ls -la /etc/alternatives/java*

Note: Due to some problems with ‘jar’ during compilation it is necessary to update the PATH by

sudo gedit /etc/environment

and append at the end of path the path to java directly


Reboot system afert above and finnaly check which version is active

java -version  

should be

java version “1.6.0_45”
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)

4. Download necessary Ubuntu packages

sudo apt-get install gperf git repo bison u-boot-tools

5. Get the source code

repo init -u -b android-4.4.4_r2
repo sync -c

6. Initialize environment

source build/

7. Choose target


and select 9 or 10 option

8. Start compilation


Note: When first time run it is necessary to copy latest repo and assign name, email for git

Michał Wołowik

Software, hardware embedded engineer. Current duties: Linux(YOCTO) and Android(AOSP) images preparation. Main duties are to develop c/c++ application.

Leave a Reply