對tar.z進行安裝和卸載
# zcat jdk-6u10-beta-solaris-sparc.tar.Z | tar -xf - (解壓文件,執(zhí)行一次就可以) # pkgadd -d . SUNWj6rt SUNWj6dev SUNWj6cfg SUNWj6man SUNWj6dmo (Default install)
# pkgadd -d . -a /export/default SUNWj6rt SUNWj6dev SUNWj6cfg SUNWj6man SUNWj6dmo (No default install)
執(zhí)行自定義路徑安裝命令之前,需做如下配置:
1、 拷貝安裝配置文件到/export/目錄下
#cp /var/sadm/install/admin/default /export/default
2、 設(shè)置自定義安裝路徑:
# cd /export
# vi default
"default" [Read only] 22 lines, 363 characters
#
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#ident "@(#)default 1.7 04/12/21 SMI"
#
mail=
instance=unique
partial=ask
runlevel=ask
idepend=ask
rdepend=ask
space=ask
setuid=ask
conflict=ask
action=ask
networktimeout=60
networkretries=3
authentication=quit
keystore=/var/sadm/security
proxy=
basedir=/usr/local #設(shè)定自定義安裝路徑
3、 JDK的默認安裝路徑為:/usr/jdk/instances/,自定義安裝路徑為:/usr/local/執(zhí)行下列命令:
# cd /jdk-install-path/bin
# ./java -version (查看Java 版本號)
# ./java -fullversion
4、 查看JDK的安裝目錄結(jié)構(gòu),執(zhí)行下列命令:
# cd /java-install-path
# ls -l
5、 查看JDK的安裝信息,執(zhí)行下列命令:
# pkginfo SUNWj6rt SUNWj6dev SUNWj6cfg SUNWj6man SUNWj6dmo
JDK 卸載步驟:
1、 在命令行中執(zhí)行下列命令:
# cd /
# pkgrm SUNWj6rt SUNWj6dev SUNWj6cfg SUNWj6man SUNWj6dmo
2、 查看下列目錄是否為空:
# cd /java-install-path
# ls