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:
- deb http://za.archive.ubuntu.com/ubuntu/ intrepid main restricted
- deb http://za.archive.ubuntu.com/ubuntu/ intrepid multiverse
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 |
echo $JAVA_HOME
gedit /etc/csh.login
source /etc/csh.login
No comments:
Post a Comment