1. I am on Ubuntu 8.10 which seems to only support Eclipse 3.2 from Synaptic Package Manager. Since I installed both Eclipse and the IcedTea OpenJDK/JRE from Synaptic, I found out later that Android Dev tool actually needed the Sun JDK in order to use its Layout Editor (otherwise you won’t be able to use Android Layout Editor to edit xml files under res/layout folder. The error was java.awt.font wasn’t found something like that.) What I ended up doing was I uninstalled both Eclipse and IcedTea distribution of JDK (openjdk-6-jdk) from Synaptic, otherwise the newly updated Eclipse will continue to use openjdk which prevented me from using Android Layout Editor.
2. Install Sun’s Java (both jre and jdk).
Every step described in the above article worked for me except I couldn’t get the first step work which was:
sudo apt-get install sun-java6-jdk
apt-get said it could not locate sun-java6-jdk something like that.
So I went with this:
sudo aptitude search sun-java
Which told also me it wasn’t able to find sun-java first time I ran it. But after I did
sudo aptitude
and ->Actions->Update package list
I got to install sun java:
sudo aptitude install sun-java6-jre sun-java6-jdk sun-java6-plugin sun-java6-fonts
I was very happy with aptitude as compared to Synaptic package manager because of the exotic flavor of the former. Besides it seems to be more stable and responsive to me based on my judgement.;)
However, during the adventure, I got confused as to how I could single/full-heartedly accept the license agreement which showed up as a pop up within shell. It turned out I had to maximize the whole thing and scroll down and use TAB key to select “OK” in order to advance.
After all this settled down, I rebooted Ubuntu and made sure that icedTea no longer took over the java world:
java -version
I get
java version "1.6.0_13"
Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
Java HotSpot(TM) Server VM (build 11.3-b02, mixed mode)
3. Install and setup Eclipse 3.4.
I manually downloaded Eclipse 3.4 from their site and unzip it into /usr/lib folder. Android dev page recommends Eclipse IDE for Java EE Developers, Eclipse IDE for Java Developers, or Eclipse for RCP/Plug-in Developers.
You may want to temporarily change the owner of the/usr/lib folder to yourself instead of root:
chown <user> /usr/lib
After you are done, go to Eclipse->Help->About Eclipse Platform->Configuration Details, you can see Eclipse is now using the Sun jdk/jre:
java.library.path=/usr/lib/jvm/java-6-sun-1.6.0.10/jre/lib/i386/client:/usr/lib/jvm/java-6-sun-1.6.0.10/jre/lib/i386:/usr/lib/xulrunner-addons:/usr/lib/xulrunner-addons:/usr/lib/xulrunner-addons:/usr/java/packages/lib/i386:/lib:/usr/lib
java.runtime.name=Java(TM) SE Runtime Environment
java.runtime.version=1.6.0_10-b33
and
java.awt.graphicsenv=sun.awt.X11GraphicsEnvironment
4. Install Android Development Tool for Eclipse. I personally found/suspected that the http url is faster/more stable(?) than the https one, esp if you are in slow connection. If you are behind some firewall, you may want to set Eclipse’s proxy. Eclispe->Window->Preferences->General->Network Connections->…
5. Configure BASH to export the JAVA_HOME env variable, as well as path to Eclipse like so:
sudo gedit /home/<user>/.bashrc
# ~~~~~~~~~~~~~~~~~ JAVA (JDK,JRE) ~~~~~~~~~~~~~~~~~~~~~
export JAVA_HOME=’/usr/lib/jvm/java-6-sun-1.6.0.10′
export ANDROID_HOME=’/usr/lib/android-sdk-linux_x86-1.5_r2′
PATH=.:$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH:$ANDROID_HOME/tools
alias eclipse=’java -jar /usr/lib/eclipse/startup.jar’
6. (Optional) Configure Eclipse JRE to the one we just installed from Sun. Eclipse->Window->Preferences->Java->Installed JREs->Add->Standard VM->/usr/lib/jvm/java-6-sun-1.6.0.10. And check this new one we just added.
7. You may want to run
Eclipse -clean
if you had some trouble with it during the process.
8. I guess that’s pretty much about it(?)!
9. Have a great weekend/holiday!