IT Tutorial

Install Java

The modern web-browsing experience requires Java. Here's how to install Java and caffeinate your web browser.
Ubuntu's an amazing Linux distribution for lots of different reasons, but one of the things people find attractive about it is the fact that it ships with lots of different software, preconfigured and ready to use. However, until recently, one of the things that the Ubuntu developers couldn't include was the Sun Java Runtime Environment (JRE), because it used a nonfree license that prevented its bundling with a Linux distribution.
Recently, however, Sun Microsystems relaxed the restrictions on the Java license, introducing the Distro License for Java (DLJ). This new license allows distributors to ship Sun's JRE and Java Development Kit (JDK) as installable packages, rather than the self-extracting binaries that were previously available. It also gives Linux distributors the ability to define the packaging, installation, and support for Java within their Linux distribution.
As such, Dapper Drake now ships with Sun's Java available as a non-free package in the multiverse repository. You'll need to have the universe and multiverse repositories enabled to install Java.
The Ubuntu developers have separated the Java components into several packages:

sun-java5-bin
Contains the binaries
sun-java5-demo
Contains demos and examples
sun-java5-doc
Contains the documentation
sun-java5-fonts
Contains the Lucida TrueType fonts from the JRE
sun-java5-jdk
Contains the metapackage for the JDK
sun-java5-jre
Contains the metapackage for the JRE
sun-java5-plugin
Contains the plug-in for Mozilla-based browsers
sun-java5-source
Contains source files for the JDK
Installing the Java Runtime Environment
Once you've got the multiverse repository enabled, installing Sun's Java package is easy. Simply open a terminal window and apt-get the package. Since you are going to be installing the JRE and the web browser plug-in, you'll be using the following command from a terminal window:
bill@constellation:~$ sudo apt-get install sun-java5-jre sun-java5-plugin \\
sun-java5-fonts


Once apt-get downloads the packages and begins the installation, you'll get a screen that contains the Sun Operating System Distributor License for Java. Read the license, if you wish, and hit Enter to continue. You'll see a dialog that asks you if you agree with the DLJ license terms. Select Yes, and hit Enter; the JRE will finish installing.
At this point, Java is installed.
Confirming the Installation
You'll want to confirm that your system is configured properly for Sun's JRE. This is a two-step process. First, check that the JRE is properly installed by running the following command from a terminal. You should get similar output:
bill@constellation:~$ java -version
java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)
If you see an unexpected version of Javain particular, one identified as "gij (GNU libgcj)"then you probably have GNU Java installed. You can easily switch from one Java to another with the command sudo update-alternatives --config java, which will prompt you to choose which Java implementation to use. Pick the one in /usr/lib/jvm to use the JRE you just installed.
If the JRE is properly installed, confirm that the Java plug-in is installed in your browser by opening Firefox and typing about:plugins in the address bar
Congratulations, you've caffeinated your browser! You can now surf to Java-enabled web sites and use Java applications!






Install Java