Android Build Details

Getting JDK5 for Ubuntu

If you are running an Ubuntu >9.04, then you will not have JDK5 available, only the JDK6.

Either add the following to /etc/apt/sources.list

deb http://us.archive.ubuntu.com/ubuntu jaunty-updates main multiverse

and then run

aptitude update
aptitude install sun-java5-jdk

or get the following files directly:

http://mirrors.kernel.org/ubuntu/pool/multiverse/s/sun-java5/sun-java5-bin_1.5.0-18-1_i386.deb
http://mirrors.kernel.org/ubuntu/pool/multiverse/s/sun-java5/sun-java5-jdk_1.5.0-18-1_i386.deb
http://mirrors.kernel.org/ubuntu/pool/multiverse/s/sun-java5/sun-java5-jre_1.5.0-18-1_all.deb
http://mirrors.kernel.org/ubuntu/pool/multiverse/s/sun-java5/sun-java5-demo_1.5.0-18-1_i386.deb

You may need to update the alternatives:

marajade-[/tmp] mcr 8066 %sudo update-alternatives --config java                                       
There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                      Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-6-openjdk/jre/bin/java   1061      auto mode
* 1            /usr/lib/jvm/java-1.5.0-sun/jre/bin/java   53        manual mode
  2            /usr/lib/jvm/java-6-openjdk/jre/bin/java   1061      manual mode

Press enter to keep the current choice[*], or type selection number: 1
marajade-[/tmp] mcr 8067 %sudo update-alternatives --config javac
There are 2 choices for the alternative javac (providing /usr/bin/javac).

  Selection    Path                                   Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-6-openjdk/bin/javac   1061      auto mode
* 1            /usr/lib/jvm/java-1.5.0-sun/bin/javac   53        manual mode
  2            /usr/lib/jvm/java-6-openjdk/bin/javac   1061      manual mode

Press enter to keep the current choice[*], or type selection number: 1
marajade-[/tmp] mcr 8068 %sudo update-alternatives --config javah
There are 2 choices for the alternative javah (providing /usr/bin/javah).

  Selection    Path                                   Priority   Status
------------------------------------------------------------
* 0            /usr/lib/jvm/java-6-openjdk/bin/javah   1061      auto mode
  1            /usr/lib/jvm/java-1.5.0-sun/bin/javah   53        manual mode
  2            /usr/lib/jvm/java-6-openjdk/bin/javah   1061      manual mode

Press enter to keep the current choice[*], or type selection number: 1
update-alternatives: using /usr/lib/jvm/java-1.5.0-sun/bin/javah to provide /usr/bin/javah (javah) in manual mode.

or you should be able to override which JVM is on the path. This allows you to have both java5 (required for AOSP and Vphone) as well as java6 (used for CyanogenMod) on the device and switch between them.

JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME PATH

java -version