Friday, 25 April 2014

How to upgrade JAVA version & Degrade Java version in solaris?

1)Extract given software
#tar -xvf jdk-6u45-solaris-sparc.tar
# ls
COPYRIGHT                    SUNWj6dev                    SUNWjavadb-client            SUNWjavadb-docs              jdk-6u45-solaris-sparc.tar
LICENSE                      SUNWj6jmp                    SUNWjavadb-common            SUNWjavadb-javadoc
README.html                  SUNWj6man                    SUNWjavadb-core              SUNWjavadb-service
SUNWj6cfg                    SUNWj6rt                     SUNWjavadb-demo              THIRDPARTYLICENSEREADME.txt
2)check current java version
# pkginfo -l SUNWj6cfg
   PKGINST:  SUNWj6cfg
      NAME:  JDK 6.0 Host Config. (1.6.0_30)
  CATEGORY:  system
      ARCH:  sparc
   VERSION:  1.6.0,REV=2006.11.29.05.57
   BASEDIR:  /
    VENDOR:  Sun Microsystems, Inc.
      DESC:  Java Platform host specific configuration
    PSTAMP:  jdk-sol-sparc20111110063558
  INSTDATE:  Oct 20 2013 18:07
   HOTLINE:  Please contact your local service provider
    STATUS:  completely installed
     FILES:        5 installed pathnames
                   5 shared pathnames
                   3 directories
# pkginfo -l SUNWj6dev
   PKGINST:  SUNWj6dev
      NAME:  JDK 6.0 Dev. Tools (1.6.0_30)
  CATEGORY:  system
      ARCH:  sparc
   VERSION:  1.6.0,REV=2006.11.29.05.57
   BASEDIR:  /usr
    VENDOR:  Sun Microsystems, Inc.
      DESC:  Java Platform development tools
    PSTAMP:  jdk-sol-sparc20111110063605
  INSTDATE:  Oct 20 2013 18:07
   HOTLINE:  Please contact your local service provider
    STATUS:  completely installed
     FILES:      590 installed pathnames
                  32 shared pathnames
                  67 directories
                  31 executables
              156426 blocks used (approx)

# pkginfo -l SUNWj6jmp
ERROR: information for "SUNWj6jmp" was not found
# pkginfo -l SUNWj6man
   PKGINST:  SUNWj6man
      NAME:  JDK 6.0 Man Pages (1.6.0_30)
  CATEGORY:  system
      ARCH:  sparc
   VERSION:  1.6.0,REV=2006.12.07.16.37
   BASEDIR:  /usr
    VENDOR:  Sun Microsystems, Inc.
      DESC:  Java Platform manual pages
    PSTAMP:  jdk-sol-sparc20111110063622
  INSTDATE:  Oct 20 2013 18:07
   HOTLINE:  Please contact your local service provider
    STATUS:  completely installed
     FILES:       45 installed pathnames
                   3 shared pathnames
                   5 directories
                1326 blocks used (approx)
# pkginfo -l SUNWj6rt
   PKGINST:  SUNWj6rt
      NAME:  JDK 6.0 Runtime Env. (1.6.0_30)
  CATEGORY:  system
      ARCH:  sparc
   VERSION:  1.6.0,REV=2006.11.29.05.57
   BASEDIR:  /usr
    VENDOR:  Sun Microsystems, Inc.
      DESC:  Java Platform virtual machine and core class libraries
    PSTAMP:  jdk-sol-sparc20111110063532
  INSTDATE:  Oct 20 2013 18:07
   HOTLINE:  Please contact your local service provider
    STATUS:  completely installed
     FILES:      955 installed pathnames
                  57 shared pathnames
                 154 directories
                  82 executables
              240523 blocks used (approx)
# pkginfo -l SUNWjavadb-client
ERROR: information for "SUNWjavadb-client" was not found
# pkginfo -l SUNWjavadb-common
   PKGINST:  SUNWjavadb-common
      NAME:  Java DB common files
  CATEGORY:  application
      ARCH:  sparc
   VERSION:  10.6.2,REV=2010.10.29
   BASEDIR:  /opt
    VENDOR:  Sun Microsystems, Inc.
      DESC:  Common files for Java DB
    PSTAMP:  astra0720101029034436
  INSTDATE:  Oct 08 2013 11:09
   HOTLINE:  Please contact your local service provider
    STATUS:  completely installed
     FILES:        6 installed pathnames
                   1 shared pathnames
                   1 directories
                 100 blocks used (approx)
# pkginfo -l SUNWjavadb-core
   PKGINST:  SUNWjavadb-core
      NAME:  Java DB core
  CATEGORY:  application
      ARCH:  sparc
   VERSION:  10.6.2,REV=2010.10.29
   BASEDIR:  /opt
    VENDOR:  Sun Microsystems, Inc.
      DESC:  Core software for Java DB
    PSTAMP:  astra0720101029034438
  INSTDATE:  Oct 08 2013 11:09
   HOTLINE:  Please contact your local service provider
    STATUS:  completely installed
     FILES:       42 installed pathnames
                   1 shared pathnames
                   3 directories
                  19 executables
                8726 blocks used (approx)
# pkginfo -l SUNWjavadb-demo
ERROR: information for "SUNWjavadb-demo" was not found
# pkginfo -l SUNWjavadb-docs
ERROR: information for "SUNWjavadb-docs" was not found
# pkginfo -l SUNWjavadb-javadoc
ERROR: information for "SUNWjavadb-javadoc" was not found
# pkginfo -l SUNWjavadb-service
ERROR: information for "SUNWjavadb-service" was not found

# java -version
java version "1.6.0_30"
Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
Java HotSpot(TM) Server VM (build 20.5-b03, mixed mode)

3) Check java version installed
# pwd
/usr
# cd jdk
# ls
instances      j2sdk1.4.2_32  jdk1.5.0_30    jdk1.6.0_30    latest         packages
# cd jdk1.6.0_30
# ls
COPYRIGHT                    README_zh_CN.html            include                      register.html                src.zip
LICENSE                      THIRDPARTYLICENSEREADME.txt  jre                          register_ja.html
README.html                  bin                          lib                          register_zh_CN.html
README_ja.html               demo                         man                          sample
# cd bin
# ls
ControlPanel   idlj           javac          jconsole       jmap           jstat          orbd           rmiregistry    tnameserv
HtmlConverter  jar            javadoc        jcontrol       jps            jstatd         pack200        schemagen      unpack200
appletviewer   jarsigner      javah          jdb            jrunscript     jvisualvm      policytool     serialver      wsgen
apt            java           javap          jhat           jsadebugd      keytool        rmic           servertool     wsimport
extcheck       java-rmi.cgi   javaws         jinfo          jstack         native2ascii   rmid           sparcv9        xjc
# ./java -version
java version "1.6.0_30"
Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
Java HotSpot(TM) Server VM (build 20.5-b03, mixed mode)
# echo $PATH
/usr/bin:/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin/:/usr/local/sbin
#
# ls -ld /usr/java
lrwxrwxrwx   1 root     other         15 Oct 20  2013 /usr/java -> jdk/jdk1.6.0_30
# pwd
/usr/jdk/instances/jdk1.6.0/bin
# cd /usr
# cd jdk
# ls
instances      j2sdk1.4.2_32  jdk1.5.0_30    jdk1.6.0_30    latest         packages

4)add following packages

#pkgadd -d . SUNWj6cfg SUNWj6dev SUNWj6man SUNWj6rt
(OR)
# pkgadd -d . SUNWj6cfg
Processing package instance <SUNWj6cfg> from </tmp/today>
JDK 6.0 Host Config. (1.6.0_45)(sparc) 1.6.0,REV=2006.11.29.05.57
Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
This appears to be an attempt to install the same architecture and
version of a package which is already installed.  This installation
will attempt to overwrite this package.
Using </> as the package base directory.
## Processing package information.
## Processing system information.
   3 package pathnames are already properly installed.
## Verifying package dependencies.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
## Checking for setuid/setgid programs.
This package contains scripts which will be executed with super-user
permission during the process of installing this package.
Do you want to continue with the installation of <SUNWj6cfg> [y,n,?] y
Installing JDK 6.0 Host Config. (1.6.0_45) as <SUNWj6cfg>
## Installing part 1 of 1.
[ verifying class <none> ]
[ verifying class <preserve> ]
## Executing postinstall script.
Installation of <SUNWj6cfg> was successful.
# pkgadd -d . SUNWj6dev
Processing package instance <SUNWj6dev> from </tmp/today>
JDK 6.0 Dev. Tools (1.6.0_45)(sparc) 1.6.0,REV=2006.11.29.05.57
Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
This appears to be an attempt to install the same architecture and
version of a package which is already installed.  This installation
will attempt to overwrite this package.
Using </usr> as the package base directory.
## Processing package information.
## Processing system information.
   500 package pathnames are already properly installed.
## Verifying package dependencies.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
## Checking for setuid/setgid programs.
This package contains scripts which will be executed with super-user
permission during the process of installing this package.
Do you want to continue with the installation of <SUNWj6dev> [y,n,?] y
Installing JDK 6.0 Dev. Tools (1.6.0_45) as <SUNWj6dev>
## Installing part 1 of 1.
:
:
:
/usr/jdk/instances/jdk1.6.0/src.zip
[ verifying class <none> ]
## Executing postinstall script.
Installation of <SUNWj6dev> was successful.
# ls
COPYRIGHT                    SUNWj6dev                    SUNWjavadb-client            SUNWjavadb-docs              jdk-6u45-solaris-sparc.tar
LICENSE                      SUNWj6jmp                    SUNWjavadb-common            SUNWjavadb-javadoc
README.html                  SUNWj6man                    SUNWjavadb-core              SUNWjavadb-service
SUNWj6cfg                    SUNWj6rt                     SUNWjavadb-demo              THIRDPARTYLICENSEREADME.txt
# pkgadd -d . SUNWj6man
Processing package instance <SUNWj6man> from </tmp/today>
JDK 6.0 Man Pages (1.6.0_45)(sparc) 1.6.0,REV=2006.12.07.16.37
Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
This appears to be an attempt to install the same architecture and
version of a package which is already installed.  This installation
will attempt to overwrite this package.
:
:
:
/usr/jdk/instances/jdk1.6.0/man/man1/xjc.1
[ verifying class <none> ]
Installation of <SUNWj6man> was successful.
# ls
COPYRIGHT                    SUNWj6dev                    SUNWjavadb-client            SUNWjavadb-docs              jdk-6u45-solaris-sparc.tar
LICENSE                      SUNWj6jmp                    SUNWjavadb-common            SUNWjavadb-javadoc
README.html                  SUNWj6man                    SUNWjavadb-core              SUNWjavadb-service
SUNWj6cfg                    SUNWj6rt                     SUNWjavadb-demo              THIRDPARTYLICENSEREADME.txt
# pwd
/tmp/today
# cd /usr/jdk
# ls
instances      j2sdk1.4.2_32  jdk1.5.0_30    jdk1.6.0_30    latest         packages
# java -varesion
Unrecognized option: -varesion
Could not create the Java virtual machine.
# java -version
java version "1.6.0_30"
Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
Java HotSpot(TM) Server VM (build 20.5-b03, mixed mode)
#
#
#
# cd /tmp/today
# ls
COPYRIGHT                    SUNWj6dev                    SUNWjavadb-client            SUNWjavadb-docs              jdk-6u45-solaris-sparc.tar
LICENSE                      SUNWj6jmp                    SUNWjavadb-common            SUNWjavadb-javadoc
README.html                  SUNWj6man                    SUNWjavadb-core              SUNWjavadb-service
SUNWj6cfg                    SUNWj6rt                     SUNWjavadb-demo              THIRDPARTYLICENSEREADME.txt
# pkgadd -d . SUNWj6rt
Processing package instance <SUNWj6rt> from </tmp/today>
JDK 6.0 Runtime Env. (1.6.0_45)(sparc) 1.6.0,REV=2006.11.29.05.57
Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
This appears to be an attempt to install the same architecture and
version of a package which is already installed.  This installation
will attempt to overwrite this package.
Using </usr> as the package base directory.
## Processing package information.
## Processing system information.
   122 package pathnames are already properly installed.
## Verifying package dependencies.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
## Checking for setuid/setgid programs.
This package contains scripts which will be executed with super-user
permission during the process of installing this package.
Do you want to continue with the installation of <SUNWj6rt> [y,n,?] y
Installing JDK 6.0 Runtime Env. (1.6.0_45) as <SUNWj6rt>
## Installing part 1 of 1.
/usr/jdk/instances/jdk1.6.0/COPYRIGHT
/usr/jdk/instances/jdk1.6.0/bin/java
:
:
/usr/jdk/instances/jdk1.6.0/jre/lib/zi/Africa/Maseru
/usr/jdk/instances/jdk1.6.0/jre/lib/zi/Africa/Mbabane
[ verifying class <none> ]
## Executing postinstall script.
Installation of <SUNWj6rt> was successful.
5)OBSERVER links automatically generates
# ls
COPYRIGHT                    SUNWj6dev                    SUNWjavadb-client            SUNWjavadb-docs              jdk-6u45-solaris-sparc.tar
LICENSE                      SUNWj6jmp                    SUNWjavadb-common            SUNWjavadb-javadoc
README.html                  SUNWj6man                    SUNWjavadb-core              SUNWjavadb-service
SUNWj6cfg                    SUNWj6rt                     SUNWjavadb-demo              THIRDPARTYLICENSEREADME.txt
# cd /usr/jdk
# ls
instances      j2sdk1.4.2_32  jdk1.5.0_30    jdk1.6.0_45    latest         packages
# ls -ld /usr/java
lrwxrwxrwx   1 root     other         15 Apr 25 23:35 /usr/java -> jdk/jdk1.6.0_45
# java -version
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) Server VM (build 20.45-b01, mixed mode)

# pkginfo -l SUNWj6cfg SUNWj6dev SUNWj6rt SUNWj6man
   PKGINST:  SUNWj6cfg
      NAME:  JDK 6.0 Host Config. (1.6.0_45)
  CATEGORY:  system
      ARCH:  sparc
   VERSION:  1.6.0,REV=2006.11.29.05.57
   BASEDIR:  /
    VENDOR:  Sun Microsystems, Inc.
      DESC:  Java Platform host specific configuration
    PSTAMP:  sc14ar01-z620130326145941
  INSTDATE:  Apr 25 2014 23:33
   HOTLINE:  Please contact your local service provider
    STATUS:  completely installed
     FILES:        5 installed pathnames
                   5 shared pathnames
                   3 directories
   PKGINST:  SUNWj6dev
      NAME:  JDK 6.0 Dev. Tools (1.6.0_45)
  CATEGORY:  system
      ARCH:  sparc
   VERSION:  1.6.0,REV=2006.11.29.05.57
   BASEDIR:  /usr
    VENDOR:  Sun Microsystems, Inc.
      DESC:  Java Platform development tools
    PSTAMP:  sc14ar01-z620130326145944
  INSTDATE:  Apr 25 2014 23:33
   HOTLINE:  Please contact your local service provider
    STATUS:  completely installed
     FILES:      590 installed pathnames
                  32 shared pathnames
                  67 directories
                  31 executables
              155920 blocks used (approx)
   PKGINST:  SUNWj6man
      NAME:  JDK 6.0 Man Pages (1.6.0_45)
  CATEGORY:  system
      ARCH:  sparc
   VERSION:  1.6.0,REV=2006.12.07.16.37
   BASEDIR:  /usr
    VENDOR:  Sun Microsystems, Inc.
      DESC:  Java Platform manual pages
    PSTAMP:  sc14ar01-z620130326145945
  INSTDATE:  Apr 25 2014 23:34
   HOTLINE:  Please contact your local service provider
    STATUS:  completely installed
     FILES:       45 installed pathnames
                   3 shared pathnames
                   5 directories
                1326 blocks used (approx)
   PKGINST:  SUNWj6rt
      NAME:  JDK 6.0 Runtime Env. (1.6.0_45)
  CATEGORY:  system
      ARCH:  sparc
   VERSION:  1.6.0,REV=2006.11.29.05.57
   BASEDIR:  /usr
    VENDOR:  Sun Microsystems, Inc.
      DESC:  Java Platform virtual machine and core class libraries
    PSTAMP:  sc14ar01-z620130326145940
  INSTDATE:  Apr 25 2014 23:35
   HOTLINE:  Please contact your local service provider
    STATUS:  completely installed
     FILES:      955 installed pathnames
                  57 shared pathnames
                 154 directories
                  82 executables
              239947 blocks used (approx)

6)ADD follwing pkg for JDK
pkgadd -d . SUNWj6rtx SUNWj6dvx SUNWj6dmx
# pkginfo -l SUNWj6rtx
   PKGINST:  SUNWj6rtx
      NAME:  JDK 6.0 64-bit Runtime Env. (1.6.0_45)
  CATEGORY:  system
      ARCH:  sparc
   VERSION:  1.6.0,REV=2006.11.29.04.58
   BASEDIR:  /usr
    VENDOR:  Sun Microsystems, Inc.
      DESC:  Java Platform virtual machine and core class libraries (64 bit)
    PSTAMP:  sc14ar01-z520130326143954
  INSTDATE:  Apr 26 2014 13:54
   HOTLINE:  Please contact your local service provider
    STATUS:  completely installed
     FILES:       85 installed pathnames
                   8 shared pathnames
                  16 directories
                  65 executables
               53034 blocks used (approx)
# pkginfo -l SUNWj6dvx
   PKGINST:  SUNWj6dvx
      NAME:  JDK 6.0 64-bit Dev. Tools (1.6.0_45)
  CATEGORY:  system
      ARCH:  sparc
   VERSION:  1.6.0,REV=2006.11.29.04.58
   BASEDIR:  /usr
    VENDOR:  Sun Microsystems, Inc.
      DESC:  Java Platform development tools (64-bit)
    PSTAMP:  sc14ar01-z520130326143955
  INSTDATE:  Apr 26 2014 13:54
   HOTLINE:  Please contact your local service provider
    STATUS:  completely installed
     FILES:       53 installed pathnames
                  12 shared pathnames
                  21 directories
                  28 executables
                3356 blocks used (approx)
# pkginfo -l SUNWj6dmx
   PKGINST:  SUNWj6dmx
      NAME:  JDK 6.0 64-bit Demo Programs (1.6.0_26)
  CATEGORY:  system
      ARCH:  sparc
   VERSION:  1.6.0,REV=2006.11.29.04.58
   BASEDIR:  /usr
    VENDOR:  Sun Microsystems, Inc.
      DESC:  Java Platform demonstration applications and applets (64-bit)
    PSTAMP:  j2se-build20110504060514
  INSTDATE:  May 05 2012 00:44
   HOTLINE:  Please contact your local service provider
    STATUS:  completely installed
     FILES:       37 installed pathnames
                  21 shared pathnames
                  29 directories
                   8 executables
                 296 blocks used (approx)

(0R) if link not generated automatically uneed to generate link

Need to edit /etc/profile  file
PATH=$PATH:/usr/local/bin:/usr/local/sbin:/usr/sbin:/usr/jdk/instances/jdk1.6.0/bin
export PATH

#cd /usr
Remove java file which is refering old java version path.
#rm java
Create softlink with New java version.
#ln -s  jdk/jdk1.6.0_45 /usr/java

1)TO revert degrade java version java1.6 to java 1.5
# ls -ld /usr/java
lrwxrwxrwx   1 root     root          15 Apr 25 23:52 /usr/java -> jdk/jdk1.6.0_45
# java -version
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) Server VM (build 20.45-b01, mixed mode)
# rm /usr/java
# pwd
/usr
# ln -s jdk/jdk1.5.0_30 /usr/java
# java -version
java version "1.5.0_30"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_30-b03)
Java HotSpot(TM) Server VM (build 1.5.0_30-b03, mixed mode)

No comments:

Post a Comment