Installing Java 7 on Ubuntu 12.04

Posted on Friday, October 12, 2012

Looks like Oracle has finally pulled the plug on using apt-get to install Java6.  According to this site [1] the java package will no longer be available for easy apt-get downloads...

I used to be able to 

Edit /etc/apt/sources.list.

       > sudo pico /etc/apt/sources.list

Add the following at the bottom

deb lucid partner

Run this from the command line

       >  sudo apt-get update

      Run this from the command line to install Java

       >  sudo apt-get install sun-java6-jdk

But that no longer works...  Here are the steps I tool to install Java7 on my Ubuntu server.

Go to 

And click on Download

Click on the “Accept License” Button  then click on the version you want to download.

It used to be that you could then copy the link and use a wget from the command line to get the file, but no longer.   So manually download the version you want.

Untar it

       >  tar -xvf jre-7-linux-i586.tar.gz

Move JRE folder to /usr/lib

       >  sudo mkdir /usr/lib/jvm
       >  sudo mv jre1.7.0_03 /usr/lib/jvm/jre1.7.0_03


       >  sudo ln -fs /usr/lib/jvm/jre1.7.0_03/bin/java /usr/bin/java

Now if you run 

       >  java -version

You should get the correct response

[1]  Java Packages in Partner archive to be removed 2012-02-16

       Visited 2/2012

No comments:

Post a Comment