Tag Archives: android building

Setup Ubuntu 13.04 raring for Android building

So what’s up with Ubuntu 13.04 raring and android building?
Basically the process is no different than 12.04 except that you need to uses the raring bins and of course correct oracle JDK ppa.

1) check that in your /etc/apt/sources.list you have

 deb http://archive.canonical.com/ubuntu raring partner
 deb-src http://archive.canonical.com/ubuntu raring partner
deb http://archive.canonical.com/ubuntu raring main
 deb-src http://archive.canonical.com/ubuntu raring main

not “lucid”

2) as I worote in http://blog.djodjo.org/?p=284
install Oracle JDK this way:

sudo add-apt-repository ppa:webupd8team/java
 sudo apt-get update && sudo apt-get install oracle-java6-installer

then as usual:

$ sudo apt-get install git gnupg flex bison gperf build-essential \
  zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
  libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
  libgl1-mesa-dev g++-multilib mingw32 tofrodos \
  python-markdown libxml2-utils xsltproc zlib1g-dev:i386
$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so

and off you go 🙂

Install Oracle JDK on Ubuntu

This is a tutorial to manually install Oracle JDK on Ubuntu linux.

Hint: check bottom for the easiest solution.

Installing JDK6 using:

$ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
$ sudo apt-get update
$ sudo apt-get install sun-java6-jdk

will no longer work as the package has been removed completely from the partner archive due to license issue,
see https://lists.ubuntu.com/archives/ubuntu-security-announce/2012-January/001554.html

You can install OpenJDK instead

sudo apt-get install openjdk-6-jdk

However building Android with openjdk may not always work smoothly. (http://groups.google.com/group/android-building/browse_thread/thread/0e24b41f11af36a1)

Here are the instruction how to install Oraclr JDK manually:

1) Download; the 32bit or 64bit Linux “compressed binary file” – it has a “.bin” file extension

chmod u+x jdk-6u32-linux-i586.bin




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


 sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.6.0_32/bin/java" 1
 sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.6.0_32/bin/javac" 1
sudo update-alternatives --install "/usr/lib/mozilla/plugins/libjavaplugin.so" "mozilla-javaplugin.so" "/usr/lib/jvm/jdk1.6.0_32/jre/lib/i386/libnpjp2.so" 1
sudo update-alternatives --config java
sudo update-alternatives --config javac
sudo update-alternatives --config mozilla-javaplugin.so
7) Check setup with 
java -version
sic@sic:~$ java -version
java version "1.6.0_32"
Java(TM) SE Runtime Environment (build 1.6.0_32-b05)
Java HotSpot(TM) Server VM (build 20.7-b02, mixed mode)

Alternatively you can do the following:

sudo add-apt-repository ppa:webupd8team/java

This will add the webupd8team PPA to your system for updated builds of Java 6/7/8 JDK (you need 6 for Android build) (https://launchpad.net/~webupd8team/+archive/java)
Then to install/update java you just need to :

 sudo apt-get update && sudo apt-get install oracle-java6-installer

enjoy 🙂