Installing Java 6 JDK on Ubuntu

None of the posts I found on this worked quite right, so I’m writing up what I did here for future reference.


sudo apt-get update
sudo apt-cache search java6

When I did this, the results I got included:


default-jdk
default-jre
default-jre-headless
openjdk-6-jdk
openjdk-6-jre
openjdk-6-jre-headless

If I’m interpreting it right, that means the Sun JDK is not available for installation via apt-get, at least the way I have it configured. But people said that the OpenJDK works fine too. So I decided to install it. It seems that specifying “default-jdk” just installs “openjdk-6-jdk” anyway:


sudo apt-get install default-jdk

When this completed, /usr/bin/java was set up for me. But I did have to add a JAVA_HOME environment variable to my .bashrc file:


export JAVA_HOME="/usr/lib/jvm/java-6-openjdk/jre"

After that, I was set to go.

Advertisements

One Response to Installing Java 6 JDK on Ubuntu

  1. website says:

    Cheers
    I really like your blog

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: