We know that default Solaris 10 has JDK 5 pre-installed. So, I went ahead to download JDK 6 from here.
From my experience, I know that all JDK installation on Solaris can be found in /usr/jdk. So I unpacked the JDK 6 binary in the same directory.
bash-3.00# cd /usr/jdk/bash-3.00# ./jdk-6u14-solaris-i586.sh
Well, after unpacking, we need to make sure that we are calling the latest JDK system-wide. Otherwise, you'll see the following:
bash-3.00# java -versionjava version "1.5.0_14"Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_14-b03)Java HotSpot(TM) Client VM (build 1.5.0_14-b03, mixed mode, sharing)bash-3.00# javac -versionjavac 1.5.0_14
This is not what we want!
So here we go: I'll try to find out the exact location of the various Java related commands.
bash-3.00# ls -al /usr/bin/java*lrwxrwxrwx 1 root other 16 Jul 3 2008 /usr/bin/java -> ../java/bin/javalrwxrwxrwx 1 root other 17 Jul 3 2008 /usr/bin/javac -> ../java/bin/javaclrwxrwxrwx 1 root other 19 Jul 3 2008 /usr/bin/javadoc -> ../java/bin/javadoclrwxrwxrwx 1 root other 17 Jul 3 2008 /usr/bin/javah -> ../java/bin/javahlrwxrwxrwx 1 root other 17 Jul 3 2008 /usr/bin/javap -> ../java/bin/javaplrwxrwxrwx 1 root other 18 Jul 3 2008 /usr/bin/javaws -> ../java/bin/javawsbash-3.00# ls -al /usr/javalrwxrwxrwx 1 root other 15 Jul 3 2008 /usr/java -> jdk/jdk1.5.0_14
So, it's simple! Remove the existing symbolic link of "usr/java" from JDK 1.5 to 1.6.
bash-3.00# rm /usr/javabash-3.00# ln -s jdk/jdk1.6.0_14 /usr/java
bash-3.00# java -versionjava version "1.6.0_14"Java(TM) SE Runtime Environment (build 1.6.0_14-b08)Java HotSpot(TM) Client VM (build 14.0-b16, mixed mode, sharing)bash-3.00# javac -versionjavac 1.6.0_14
I also did not feel easy with "latest" directory symbolic-linked to JDK 1.5 in "/usr/jdk". So I went ahead to replace it with JDK 1.6, even though I knew nothing will break.
bash-3.00# cd /usr/jdkbash-3.00# ls -altrtotal 16lrwxrwxrwx 1 root other 7 Jul 3 2008 j2sdk1.4.2_16 -> ../j2sedrwxr-xr-x 3 root bin 512 Jul 3 2008 instanceslrwxrwxrwx 1 root other 18 Jul 3 2008 jdk1.5.0_14 -> instances/jdk1.5.0lrwxrwxrwx 1 root other 11 Jul 3 2008 latest -> jdk1.5.0_14drwxr-xr-x 8 root bin 512 Jul 3 2008 packagesdrwxrwxr-x 10 root root 512 Jun 23 13:12 jdk1.6.0_14drwxr-xr-x 5 root bin 512 Jun 23 13:15 .drwxr-xr-x 40 root sys 1024 Jun 23 13:17 ..bash-3.00# rm latestbash-3.00# ln -s jdk1.6.0_14 latestbash-3.00# ls -altrtotal 16lrwxrwxrwx 1 root other 7 Jul 3 2008 j2sdk1.4.2_16 -> ../j2sedrwxr-xr-x 3 root bin 512 Jul 3 2008 instanceslrwxrwxrwx 1 root other 18 Jul 3 2008 jdk1.5.0_14 -> instances/jdk1.5.0drwxr-xr-x 8 root bin 512 Jul 3 2008 packagesdrwxrwxr-x 10 root root 512 Jun 23 13:12 jdk1.6.0_14drwxr-xr-x 40 root sys 1024 Jun 23 13:17 ..lrwxrwxrwx 1 root root 11 Jun 23 13:24 latest -> jdk1.6.0_14drwxr-xr-x 5 root bin 512 Jun 23 13:24 .
No comments:
Post a Comment