Mar

14

Java is a must-have to everybody. Expecially if you are a web surfer.

If you have the universe and multiverse repositories enabled, to install Java is really easy.

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

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:

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:shi@shilaptop:~$ 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 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. You should see something like the image below:

firefox java screen shot

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.

Credit: Ubuntu Hacks by O’reilly



Similar Posts

Comments

Name (required)

Email (required)

Website

Speak your mind

1 Comment so far

  1. Install BitTorrent GUI Azureus on Ubuntu | Highub - Web Development Blog on April 8, 2008 10:23 am

    [...] updates, and a dedicated development team. Before you can use the program, however, you need to install Java, since Azureus requires it. (Sun’s licensing, however, makes it impossible for Ubuntu to [...]

Sponsors




Links