Java On Ubuntu

This page details the steps necessary to install Java on the Ubuntu distribution of Linux. The particular steps for each release are listed below.

Ubuntu 11.10 (Oneiric Ocelot)

Ubuntu's repository provides an alternative version of Java SE called OpenJDK. The OpenJDK project attempts to provide an open-source implementation of the Java platform, and is the preferred version of Java for Ubuntu. For more details on OpenJDK, see external link: http://openjdk.java.net/.

OpenJDK 1.7

Java SE 1.7 is the latest-and-greatest version of Java as of Feb 21, 2012. To install the OpenJDK 1.7 JDK, open a terminal and enter the following. Note that you will need to have an active connection to the internet, and the process will download a fair amount of data (around 50-150 MB).

You will be prompted for your password (so you can modify the system software), so go ahead and enter it. After calculating what is needed for the install, you should be presented with a list of packages that will be downloaded and installed. Something like this:

Type "Y" and press <Enter> to proceed with the download and installation. When everything finishes, you can verify that the installation succeeded by executing the Java compiler (javac) and checking its version:

OpenJDK 1.6

Java SE 1.6 is an older, but more widely-deployed version of the Java platform. Installing this on Ubuntu 11.10 is similar to installing Java SE 1.7, but the package name differs slightly. To install, open a terminal and enter the following:

The remaining steps should be similar to the instructions above for Java SE 1.7.