solaris下安装jdk7

http://docs.oracle.com/javase/7/docs/webnotes/install/solaris/solaris-jdk.html

http://blog.sina.com.cn/s/blog_55fb522f0100ratv.html

安装.tar.Z 格式的

1. 根据你的机器类型,下载正确的版本。 64位的 要下两个包!
2.解压

On SPARC processors:

    zcat jdk-7u<version>-solaris-sparc.tar.Z | tar xf -
    zcat jdk-7u<version>-solaris-sparcv9.tar.Z | tar xf -
On x64/EM64T processors:

     zcat jdk-7u<version>-solaris-i586.tar.Z | tar xf -
     zcat jdk-7u<version>-solaris-x64.tar.Z | tar xf -


第一行命令创建对应的文件夹(SUNWj7rt, SUNWj7dev, SUNWj7cfg, SUNWj7man, SUNWj7jmp, SUNWjavadb-client, SUNWjavadb-common, SUNWjavadb-core, SUNWjavadb-demo, SUNWjavadb-docs, SUNWjavadb-javadoc, and SUNWjavadb-service)和一些文件在当前文件夹下

第二行命令为64位机器创建了另外一些目录
The second command creates several directories (SUNWj7rtx, SUNWj7dvx, and SUNWj7dmx) in the current directory, which contain 64-bit support for the JDK.

3. Assume the root role. You can use the roles(1) command to determine whether you are able to assume the root role.
切root用户

4. Uninstall any earlier installation of the JDK packages.

卸载以前的jdk
pkginfo | grep SUNWj 查看以前的版本
比如说查看1.6的 就是pkginfo | grep SUNWj6
比如说查看1.5的 就是pkginfo | grep SUNWj5

然后pkgrm 上边pkginfo | grep SUNWj6 的包
可能要多点几次y 呵呵
java -version 看版本 1.6删完了 还可能有1.5的 接着删
直到java -version 提示java找不到


If your machine has an earlier 32-bit or 64-bit version of the JDK installed in the default location (/usr/jdk/jdk1.<major version>.0_<minor version>), you must uninstall it before installing a later version at that location.

You can skip this step if you intend to install the JDK in a non-default location. For more details, see Selecting the Default Java Platform.

5. Run the pkgadd command to install the 32-bit and 64-bit packages.

    # pkgadd -d . SUNWj7rt SUNWj7dev SUNWj7cfg SUNWj7man
                  SUNWjavadb-client SUNWjavadb-common SUNWjavadb-core SUNWjavadb-demo
                  SUNWjavadb-docs SUNWjavadb-javadoc SUNWjavadb-service
    # pkgadd -d . SUNWj7rtx SUNWj7dvx SUNWj7dmx
The first command installs the JDK into /usr/jdk/jdk1.7.0_<version>.

The second command installs the files for 64-bit support into the JDK installation at /usr/jdk/jdk1.7.0_<version>.

See the pkgadd(1) and admin(4) man pages for information on installing the JDK in a non-default location.
安装jdk7

pkgadd -d . SUNWj7rt SUNWj7dev SUNWj7cfg SUNWj7man SUNWjavadb-client SUNWjavadb-common SUNWjavadb-core SUNWjavadb-demo
       SUNWjavadb-docs SUNWjavadb-javadoc SUNWjavadb-service

如果是64位的 加上下边的命令

pkgadd -d . SUNWj7rtx SUNWj7dvx SUNWj7dmx

如果不出意外 应该是安装好了

6. 可以忽略
For Japanese users: Install man pages.

If your machine has an earlier version of the Japanese man pages already installed in usr/jdk/jdk1.7.0_<version>, you must uninstall that package before installing this version of the Japanese man pages at that location. Remove that package by running:

    # pkgrm SUNWj7jmp
Then run the pkgadd command to install the new Japanese man page package.

    # pkgadd -d . SUNWj7jmp
7. To save space, delete the tar files and extracted SUNW* directories.

8. Exit the root role. No need to reboot.




General Installation Notes
The following are general notes about the installation.

Selecting the Default Java Platform
This section describes how the default Java platform is selected when running the Oracle Solaris SVR4 package installation (via the pkgadd command) of the JDK.

The Default Java Platform - Several versions of the Java platform can be present simultaneously on a Oracle Solaris system (using the default Oracle Solaris package installations), but only one can be the "default" Java platform. The default Java platform is defined by the directory that the /usr/java symbolic link points to. To determine the default version of the java executable, run:

    % /usr/java/bin/java -fullversion
The /usr/java symbolic link can change the default Java platform because there are symbolic links in /usr/bin (also known as /bin) that use it. (For example, the /usr/bin/java link refers to /usr/java/bin/java, which is the Java Runtime Environment). Many Java applications are compatible with later versions of the Java platform, but some applications might be less compatible.

PATH Setting - The default Java is linked through /usr/bin, such as /usr/bin/java. If this is in the path before another version of Java is in the path, then that will be the version of Java run from the command line or from any other tool that uses the PATH environment variable to locate Java.

猜你喜欢

转载自ztianlong.iteye.com/blog/1432972