Finally - Installed and configured Java 6 in Ubuntu

This took much longer than it should have, but I finally got the default JRE on my Ubuntu Linux partition on my laptop to be version 1.6. Here is how I did it:

1. Ran the command "sudo apt-get install sun-java6-bin sun-java6-fonts sun-java6-jre sun-java6-plugin" to install the necessary files on the system. apt-get is quickly becoming my best friend.

Now, normally, running the "java -version" command would specify what version of Java was identified as the default, but I consistently was receiving this:

The program 'java' can be found in the following packages:
* j2re1.4
* gij-4.1
* kaffe
* jamvm
* java-gcj-compat
* cacao
* sablevm
Try: apt-get install
Make sure you have the 'universe' component enabled
bash: java: command not found

Which was interesting since I just installed the JRE.

3. The missing piece was running the command "sudo update-alternatives --config java"

which produced this:

There are 2 alternatives which provide `java'.
Selection Alternative
-----------------------------------------------
1 /usr/bin/gij-wrapper-4.1
+ 2 /usr/lib/jvm/java-6-sun/jre/bin/java

Press enter to keep the default[*], or type selection number:

I selected 2 and then received the following:
Using `/usr/lib/jvm/java-6-sun/jre/bin/java' to provide `java'.

Now typing in "java -version" yields the expected results:

java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing)

Yet another blog post my wife couldn't care less about.


Powered by ScribeFire.

Comments

Popular posts from this blog

Nothing will stand in the way of the Word

tightvnc keyboard mapping problem in Ubuntu 9.04

The Boys of Summer