Sun Java 6 packages are being removed from Ubuntu in the near future for the following reasons:
-- As of August 24th 2011, Canonical no longer have permission to redistribute new Java packages as Oracle has retired the "Operating System Distributor License for Java".
-- Oracle has published an advisory about security issues in the version of Java currently in the partner archive. Some of these issues are currently being exploited in the wild.
-- Due to the severity of the security risk, Canonical released a security update for the Sun JDK browser plugin which disables the plugin on all machines.
-- In the near future, Canonical will remove all Sun JDK packages from the Partner archive. This will be accomplished by pushing empty packages to the archive, so that the Sun JDK will be removed from all users machines when they do a software update. Users of these packages who have not migrated to an alternative solution will experience failures after the package updates have removed Oracle Java from the system.
Install sun Java 6 using PPA
Open the terminal and run the following commands
sudo apt-add-repository ppa:flexiondotorg/java
sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-plugin