root:# /usr/lib/jre1.6.0_01/bin/java -version
java version "1.6.0_01"
Java(TM) SE Runtime Environment (build 1.6.0_01-b06)
Java HotSpot(TM) Client VM (build 1.6.0_01-b06, mixed mode, sharing)
bash: /usr/local/bin:/usr/bin:/usr/sbin:/bin:/opt/bin:/usr/X11/bin:/usr/local/games:/usr/lib/java/bin:/usr/lib/java/jre/bin:/usr/lib/qt/bin:/opt/seamonkey/bin:/usr/local/sbin:/usr/sbin:/sbin: No such file or directory
Seeing as /usr/local/bin is pathed, it makes sense to create a link from there to java:
root:# ls -l /usr/local/bin/java
lrwxrwxrwx 1 root root 29 2007-06-22 16:59 /usr/local/bin/java -> /usr/lib/jre1.6.0_01/bin/java*
But, when I type 'java -version', I get an error:
root:# java -version
bash: /usr/lib/java/bin/java: No such file or directory
Why is this? Maybe I inadvertently deleted a file? How can be sure that I am using the 1.6 java rather than the 1.5 java? Why isn't the link I created picked up on the CLI when it's clearly in the PATH?