Thursday, May 20, 2010

How to install Sun Java 6 on Ubuntu 10.04

As usual, doing an upgrade for Ubuntu removed some things I'd had installed.  The main annoyance is Java.  I do java development for a living.  All of my customers use Sun Java, no one uses OpenJDK.  While the idea of installing OpenJDK is great, it's just not ready for prime time.  Furthermore, if I had Sun Java installed already, why remove it?  Ubuntu has made it even more cryptic on how to install Sun Java.  Here are the steps:

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


Once the install is complete, do:


sudo update-alternatives --config java


and select Sun Java.


Confirm by running:


java --version


You should see:



java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode, sharing)




No comments: