page.title=Host System Setup pdk.version=1.0 doc.type=porting @jd:body
Introduction
Installing Packages
Required Packages
Ubuntu 6.06 (Dapper)
Ubuntu 7.10
Ubuntu 8.04
Installing Java

Introduction

This section provides instructions on how to configure your host system to build Android for mobile devices. While Android is designed as host-environment agnostic, it has been tested and is known to work on the following Linux operating system; Ubuntu 6.06 (Dapper), 7.10 (Gutsy), and 8.04. Cygwin is not recommended.

Installing Packages

Required Packages

Android requires the following system packages:

Ubuntu 6.06 (Dapper)

On a clean Dapper system, type the following:

% sudo apt-get install flex bison gperf libesd0-dev libwxgtk2.6-dev zlib1g-dev 
   build-essential

This snippet includes an artificial line break to maintain a print-friendly document.

Ubuntu 7.10

  1. The libwxgtk2.6-dev package will only work if the following code is included in your /etc/apt/source file.

    ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    ## team, and may not be under a free license. Please satisfy yourself as to
    ## your rights to use the software. Also, please note that software in
    ## universe WILL NOT receive any review or updates from the Ubuntu security
    ## team.
    # Line commented out by installer because it failed to verify:
    deb http://us.archive.ubuntu.com/ubuntu/ gutsy universe
    # Line commented out by installer because it failed to verify:
    deb-src http://us.archive.ubuntu.com/ubuntu/ gutsy universe
    # Line commented out by installer because it failed to verify:
    deb http://us.archive.ubuntu.com/ubuntu/ gutsy-updates universe
    # Line commented out by installer because it failed to verify:
    deb-src http://us.archive.ubuntu.com/ubuntu/ gutsy-updates universe
    

  2. Install required packages with the following command:

    % sudo apt-get install flex bison gperf libesd0-dev libwxgtk2.6-dev zlib1g-dev
       build-essential
    

    This snippet includes an artificial line break to maintain a print-friendly document.
  3. Install the X11 development environment with the following commands:

    % sudo apt-get install x-dev
    % sudo apt-get install libx11-dev
    % sudo apt-get install libncurses5-dev
    

Ubuntu 8.04

On a clean system, type the following:

% sudo apt-get install flex bison gperf libesd0-dev libwxgtk2.6-dev
zlib1g-dev build-essential
% sudo apt-get install x-dev
% sudo apt-get install libx11-dev
% sudo apt-get install libncurses5-dev
% sudo apt-get install sun-java5-jdk

Installing Java

Android source code includes a hard dependency on the Java Developer Kit (JDK) 5.0 Update 12 or greater. The specific file name of the Update 12 package is jdk-1_5_0_12-linux-i586.bin. To download this version of the Java JDK:

  1. Navigate to: http://java.sun.com/products/archive/.
  2. Select '5.0 Update 12' from the 'Java 2 Platform Standard Edition (J2SE)' -> 'JDK/JRE - 5.0' field and click 'Go.'
  3. Click 'Download JDK.'
  4. In the 'Linux Platform' section, click 'Linux self-extracting file' associated with the jdk-1_5_0_12-linux-i586.bin package.
  5. Follow the installation instructions.

Once you have cleanly installed the JDK, modify your PATH environment variable to include <jdk-install-dir>/jdk1.5.0_12/bin at its beginning so that Dapper will use the correct installation.

Ubuntu 7.10

An alternative method to quickly install Java is to enable multiverse repo in /etc/apt/sources.list and then execute:

% sudo apt-get install sun-java5-jdk