There are several implementations of Java, the 3 most common implementations when talking about it for Ubuntu are:
- OpenJDK: The primary goal of the OpenJDK project is to produce an
open-source implementation of the Java SE Platform (6 and 7). This is
the default version of Java that Ubuntu uses and is the easiest to
install.
- Sun Java: Sun Java is the reference implementation for Java 6. It's support has been discontinued in Ubuntu.
- Oracle Java: Oracle Java is the OpenJDK Java Se Platform version 7 implementation from Oracle. Oracle introduced with this implementation a license that prevents distribution.
Since Ubuntu 11.10 and due to license issues Ubuntu will no longer distribute Oracle's JDK and JRE. Also previous versions supplied on PPAs suffer from security issues are are not recommended to be installed on any Ubuntu system.
There are no more supported .deb releases from Ubuntu with reference to Sun Java or Oracle Java, Ubuntu officially supports OpenJDK and OpenJRE implementation of Java which is the base for Oracle's own implementation.
OpenJRE is the official implementation of Java Runtime Environment for your Ubuntu systems and should suffice to run any Java program that you might require and its included in the main repo and its easily installable.
OpenJRE (click to install) can be installed by opening a terminal and typing
sudo apt-get install openjdk-7-jre
Or look for openjdk-7-jre in the Ubuntu Software Center.
The openjdk-7-jre package contains just the Java Runtime Environment. If you want to develop Java programs then install the openjdk-7-jdk (click to install) package.
Also important is to install the wrapper for supporting Java applications on your web browser Iced-Tea Java Plugin.
IcedTea Plugin (click to install) can be installed on the terminal using
sudo apt-get install icedtea-plugin
Or look for icedtea-plugin in the Ubuntu Software Center
To make sure that you are running the correct version of Java use this command to set your choice
sudo update-alternatives --config java
java -version should display the choice you previously made.
If you need to install OpenJDK-JRE6 or OpenJDK-JDK6
openjdk-6-jre (click to install) is available for installation for Ubuntu 8.04 and up.
Install it with
sudo apt-get install openjdk-6-jre
Or if you need the developers package openjdk-6-jdk (click to install) install it with
sudo apt-get install openjdk-6-jdk
A version of the icedtea-plugin (click to install) is also available to install if you are going to use OpenJDK6.
Install it with
sudo apt-get install icedtea6-plugin
If you really want to use Oracle's Java Se Platform