Problem
After installing the latest version of the Java when I run the command java -version it still returns the version information for the prevoiusly installed version.
Solution
If you platform supports the alternatives mechanism, invoke it to select the new version of Java (enter /usr/sbin/alternatives --config java:
# /usr/sbin/alternatives --config java
There are 2 programs which provide 'java'.
Selection Command
-----------------------------------------------
+ 1 /usr/lib/jvm/jre-1.5.0-gcj/bin/java
* 2 /usr/java/jdk1.6.0_06/bin/java
Enter to keep the current selection[+], or type selection number: 2
This article describes the comamnds in more detail:
If this does not work then you can just update the symbolic link at /usr/bin/java to point to the new version of Java. If the new version of Java is installed at /usr/java/jdk1.6.0_06, then execute the commands:
rm -rf /usr/bin/java
ln -sf /usr/java/jdk1.6.0_06/bin/java /usr/bin/java
Charlie