Java – How to set the default java in Solaris

java

I just installed the latest java in /usr/jdk/jdk1.6.0_30

Now how do I make this java is the default java for the entire OS? As of now it is still using java 1.5

Thanks.

Best Answer

Found it...

$which java
/usr/bin/java
$ls -ld /usr/bin/java
lrwxrwxrwx 1 root other 16 Apr 8 12:41 /usr/bin/java -> ../java/bin/java
$rm /usr/bin/java
$ln -s /usr/jdk/jdk1.6.0_27/bin/java /usr/bin/java
$java -version
java version "1.6.0_27"
Java(TM) SE Runtime Environment (build 1.6.0_27-b07)
Java HotSpot(TM) Server VM (build 20.2-b06, mixed mode)