Monday, February 11, 2013

How to upgrade JDK ( Java Development Kit) solaris 10

Version existing : jdk1.5.0_34 need to be upgraded to version : jdk1.6.0_24.


1. Donwload 2 files :
   a. jdk-6u24-solaris-sparcv9.tar.Z
   b. jdk-6u24-solaris-sparc.tar.Z
source :
http://www.oracle.com/technetwork/java/javase/install-solaris-64-138849.html

2. Extract files
# pwd
/export/home/gandevtuna
# cd x64
# gunzip jdk-6u24-solaris-sparcv9.tar.Z
# tar -xf jdk-6u24-solaris-sparcv9.tar
# ls -ltr
total 54262
drwxr-xr-x   4 admin    other          512 Feb  3  2011 SUNWj6rtx
drwxr-xr-x   4 admin    other          512 Feb  3  2011 SUNWj6dvx
drwxr-xr-x   4 admin       143          512 Feb  3  2011 SUNWj6dmx
-rw-r-----   1 root     root     27753472 Feb 11 14:49 jdk-6u24-solaris-sparcv9.tar

# pwd
/export/home/gandevtuna
# cd x32
# gunzip jdk-6u24-solaris-sparc.tar.Z
# tar -xf jdk-6u24-solaris-sparc.tar
# ls -ltr
total 478536
drwxrwxr-x   4 admin  other        512 Feb  3  2011 SUNWjavadb-demo
drwxrwxr-x   4 admin  other        512 Feb  3  2011 SUNWjavadb-core
drwxrwxr-x   4 admin  other        512 Feb  3  2011 SUNWjavadb-common
drwxrwxr-x   4 admin  other        512 Feb  3  2011 SUNWjavadb-client
drwxrwxr-x   4 admin  other        512 Feb  3  2011 SUNWjavadb-service
drwxrwxr-x   4 admin  other        512 Feb  3  2011 SUNWjavadb-javadoc
drwxrwxr-x   4 admin  other        512 Feb  3  2011 SUNWjavadb-docs
drwxr-xr-x   4 admin  other        512 Feb  3  2011 SUNWj6man
drwxr-xr-x   4 admin  other        512 Feb  3  2011 SUNWj6jmp
drwxr-xr-x   4 admin  other        512 Feb  3  2011 SUNWj6dmo
drwxr-xr-x   4 admin  other        512 Feb  3  2011 SUNWj6dev
drwxr-xr-x   4 admin  other        512 Feb  3  2011 SUNWj6cfg
drwxr-xr-x   4 admin  other        512 Feb  3  2011 SUNWj6rt
-rw-rw-r--   1 admin  other         76 Feb  3  2011 THIRDPARTYLICENSEREADME.txt
-rw-rw-r--   1 admin  other      20663 Feb  3  2011 README_zh_CN.html
-rw-rw-r--   1 admin  other      25317 Feb  3  2011 README_ja.html
-rw-rw-r--   1 admin  other      28230 Feb  3  2011 README.html
-rw-rw-r--   1 admin  other       3339 Feb  3  2011 COPYRIGHT
-rw-r-----   1 admin  other    244785152 Feb 11 14:28 jdk-6u24-solaris-sparc.tar

3. install files
# pkgadd -d . SUNWj6man SUNWj6jmp SUNWj6dmo SUNWj6dev SUNWj6cfg SUNWj6rt
# pkgadd -d . SUNWj6rtx SUNWj6dvx SUNWj6dmx

4. unlink and link those files
# ls -ltr /usr/bin/java
lrwxrwxrwx   1 root     other         16 Apr 13  2012 java -> ../java/bin/java
# unlink java
# ln -s /usr/jdk/latest/bin/java /usr/bin/java


# ls -ltr /usr/jdk/
total 12
lrwxrwxrwx   1 root     other          7 Apr 13  2012 j2sdk1.4.2_19 -> ../j2se
drwxr-xr-x   8 root     bin          512 Apr 13  2012 packages
lrwxrwxrwx   1 root     other         18 Apr 29  2012 jdk1.5.0_34 -> instances/jdk1.5.0
lrwxrwxrwx   1 root     root          11 Feb  9 21:10 latest -> jdk1.5.0_34
drwxr-xr-x   7 root     bin          512 Feb  9 21:28 instances
lrwxrwxrwx   1 root     root          18 Feb  9 21:33 jdk1.6.0_24 -> instances/jdk1.6.0
# unlink latest
# ln -s jdk1.6.0_24 latest
 # ls -ltr
total 12
lrwxrwxrwx   1 root     other          7 Apr 13  2012 j2sdk1.4.2_19 -> ../j2se
drwxr-xr-x   8 root     bin          512 Apr 13  2012 packages
lrwxrwxrwx   1 root     other         18 Apr 29  2012 jdk1.5.0_34 -> instances/jdk1.5.0
drwxr-xr-x   7 root     bin          512 Feb  9 21:28 instances
lrwxrwxrwx   1 root     root          18 Feb  9 21:33 jdk1.6.0_24 -> instances/jdk1.6.0
lrwxrwxrwx   1 root     root          11 Feb 11 15:08 latest -> jdk1.6.0_24


5. Check the result

Before :
# java -version
java version "1.5.0_34"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_34-b03)
Java HotSpot(TM) Server VM (build 1.5.0_34-b03, mixed mode)
#

After:
# java -version
java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
Java HotSpot(TM) Server VM (build 19.1-b02, mixed mode)
#

6. Done
 
footer