Notatypewriter's Blog

Umm… what?

Installing Sun Java, Eclipse, and Android SDK on Ubuntu 10.04

leave a comment »

Ever since Ubuntu (and Debian) removed Sun Java from their repos, the official instructions have been out of date. (Additionally, Debian’s and Ubuntu’s wikis about installing Sun Java have become out of date.) Google knows about this since I’ve seen the issue brought up on their mailing lists, but they’ve never updated the documentation. It is yet another reason why I feel Google does not care so much about third party developers, but c’est la vie.

Additionally, the Google release cycle moves much faster than Debian’s. Ubuntu also has trouble keeping large packages like Eclipse up to date, so it’s not always certain that the version of Eclipse available in your package manager will be the version by the ADT Plugin. For example, the version of Eclipse in Natty (11.04) was 3.5, which was originally released in 2009. Google still advises developers to use Ubuntu Lucid 10.04 even with all these outdated packages. (Anyways, Linux package management doesn’t fit with today’s model of desktop computing.)

These instructions won’t require root.

  1. Download the Java .run file (JDK 6 or 7 both work), Eclipse (just the IDE for Java developers is fine), and the Android SDK.
  2. I created a directory in ~/opt to contain all of these. Unpack all three files into it.
  3. I created a directory in ~/bin and symlinked the Eclipse executable into it (ln -s ../opt/eclipse/eclipse)
  4. Edit both ~/.bashrc and ~/.profile and ensure JAVA_HOME is set to your local JDK (eg, something like JAVA_HOME=$HOME/opt/jdk1.6.0_31)
  5. Edit both ~/.bashrc and ~/.profile and ensure ~/bin, the Java executables, and the Android SDK tools are prepended to your $PATH (eg, something should be like PATH=$HOME/bin:$JAVA_HOME/bin:$HOME/opt/android-sdk-linux/tools:$HOME/opt/android-sdk-linux/platform-tools:$PATH). (Reportedly, you can set ~/.pam_environment that will do all your environment variables instead of editing and maintaining two files, but I haven’t tried that.)
  6. Logout and log back in.

You should now be able to run Eclipse. It should find your locally installed JDK in ~/opt. Once you get into Eclipse, follow the instructions for installing the ADT, which will then download the latest SDK and tools for you.

Written by notatypewriter

2012 April 15 at 11:49 am

Posted in Nerding out

Tagged with , , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: