Install Java on Ubuntu 8.10 (Intrepid Ibex)


There are several ways of installing Java on the Ubuntu operating system. One of the easiest ways is to make use of apt-get command in Ubuntu. Before the command can be executed, a few steps needs to be followed.

Setup Repository

The apt-get command makes use of a source configuration file, which contains a list of the repositories the package manager should query to retrieve the correct package. The source configuration file is known as sources.list and is situated in the /etc/apt/sources.list location. The following command can be used to edit the source file to ensure the multiverse repository is included.

Code:


sudo gedit /etc/apt/sources.list

Ensure that the following two sources are added to the configuration file:

After the configuration file is updated, the package repository needs to updated with the following command:

Code:


sudo apt-get update


Install Java Package

After the package repository was successfully updated, the Sun Java packages can be installed on the Ubuntu system. The Sun Java packages consist of Java 5 and Java 6 packages. Depending on the version that is required, the list of packages specified below can be installed.

Java 5
The Java 5 packages available is listed as follows:

  • sun-java5-bin
  • sun-java5-fonts
  • sun-java5-plugin
  • sun-java5-demo
  • sun-java5-jdk
  • sun-java5-source
  • sun-java5-doc
  • sun-java5-jre
  • sun-java5-src

Java 6
The Java 6 packages available is listed as follows:

  • sun-java6-bin
  • sun-java6-javadb
  • sun-java6-plugin
  • sun-java6-demo
  • sun-java6-jdk
  • sun-java6-source
  • sun-java6-doc
  • sun-java6-jre
  • sun-java6-src
  • sun-java6-fonts
  • sun-java6-jre-headless

To install Java version 6, the following command needs to be executed:

Code:


sudo apt-get install sun-java6-jre sun-java6-jdk sun-java6-plugin


Verify Java Installation

To verify that the correct version of java is installed the following command can be used:

Code:


java -version

This command will print the current version of java that is active. Should there be more than one version of Java be installed on the operating system, the following command can be used to list the available java versions:

Code:


update-java-alternatives -l

This command list all the available Java runtime environments on the Ubuntu system. To change from one version to another, the following command can be used:

Code:


sudo update-java-alternatives -s JRE Version

Example:
sudo update-java-alternatives -s java-6-sun


Source: http://www.javadesign.info/SystemsHardware/OS/Ubuntu/install-java-on-ubuntu


echo $JAVA_HOME

gedit /etc/csh.login
source /etc/csh.login

No comments: