solaris 10(sunos 5.10)上安装java

从官网下载64位的jdk:

Solaris SPARC 64-bit 92.9 MB jdk-8u45-solaris-sparcv9.tar.gz

 

下载后上传到主机上,

执行命令:

  gzip -dc jdk-8u45-solaris-sparcv9.tar.gz | tar xf -

 

解压完成后目录为:

  jdk1.8.0_45

 

修改当前用户下.profile文件,添加环境变量:

export JAVA_HOME=/home/java/jdk1.8.0_45

export PATH=${JAVA_HOME}/bin/sparcv9:/usr/bin:${path}

export LD_LIBRARY_PATH_64=${JAVA_HOME}/jre/lib/sparcv9/server

 

重新登录一遍,执行:

 $ java -version

java version "1.8.0_45"

Java(TM) SE Runtime Environment (build 1.8.0_45-b14)

Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

$ javac -version

javac 1.8.0_45

 

之前安装jdk1.7 ,解压,配环境变量后,执行 java -version 报错:

 Error occurred during initialization of VM

java/lang/NoClassDefFoundError: java/lang/Object

 

经查询发现jre/lib 目录下没有 rt.jar ,该jdk1.7包大小如下:

Solaris SPARC 64-bit 18.41 MB jdk-7u80-solaris-sparcv9.tar.gz

可能是更新包,所以装的不对:

Solaris SPARC上需要先安装32位jdk,再用64位覆盖上。

 

JDK文档:

nstallation of Oracle Solaris Archive Binaries (.tar.gz)

You can install a JDK archive binary in any location that you can write to. It will not displace the system version of the Java platform provided by the Oracle Solaris OS. These instructions install a private version of the JDK.

Installing the JDK on a 64-bit system that allows a 32-bit JVM is a two-step process: first install the 32-bit JDK and then install the additional support for 64-bit operations. The file names are as follows:

On SPARC processors:

    jdk-7u<version>-solaris-sparc.tar.gz     (32-bit)
    jdk-7u<version>-solaris-sparcv9.tar.gz   (64-bit)

On x64/EM64T processors:

    jdk-7u<version>-solaris-i586.tar.gz     (32-bit)
    jdk-7u<version>-solaris-x64.tar.gz      (64-bit)

If you are running a 32-bit version of Oracle Solaris, you only need to download and install the 32-bit version.

1. Download the bundles or bundle, if you are installing only the 32-bit version of Oracle Solaris. Before the file can be downloaded, you must accept the license agreement. The archive binaries can be installed by anyone in any location that you can write to.

The .tar.gz archive file (also called a tarball) is a file that can be simultaneously uncompressed and extracted in one step.

2. Change directory to the location where you would like the JDK to be installed. Move the .tar.gz archive binaries to the current directory.

3. Unpack the tarball and install the JDK.

The following steps can be performed in either order.

On SPARC processors:

    % gzip -dc jdk-7u<version>-solaris-sparc.tar.gz | tar xf -
    % gzip -dc jdk-7u<version>-solaris-sparcv9.tar.gz | tar xf -

On x64/EM64T processors:

    % gzip -dc jdk-7u<version>-solaris-i586.tar.gz | tar xf -
    % gzip -dc jdk-7u<version>-solaris-x64.tar.gz | tar xf -

The JDK is installed in a directory called jdk1.7.0_<version> in the current directory. For example, for the JDK 7 update 1 release, the directory would be named: jdk1.7.0_01.

The supplemental files for 64-bit support are installed in directories named for the machine architecture model, which are added at several locations within the same jdk1.7.0_<version> directory where the 32-bit JDK was installed. For example, on SPARC processors the 64-bit Java VM Library file (libjvm.so) is stored in the jdk1.7.0_<version>/jre/lib/sparcv9/server directory, whereas the version for x64/EM64T is stored in thejdk1.7.0_<version>/jre/lib/amd64/server directory.

The JDK documentation is a separate download. See Java SE Downloads for more information

 

jdk1.7.0_79 采用 tar.gz 方式安装后:

先安装32位,再安装64位,64位的支持大于2G内存配置,

于是 在tomcat6.0.43下catalina.sh 配置:

JAVA_OPTS=" -server -Xms8192m -Xmx8192m  -XX:PermSize=512M -XX:MaxNewSize=512m -XX:MaxPermSize=512m -Djava.awt.headless=true "

启动tomcat报错:

 Invalid initial heap size: -Xms8192m

The specified size exceeds the maximum representable size.

Error: Could not create the Java Virtual Machine.

Error: A fatal exception has occurred. Program will exit.

查看tomcat启动的命令:

/home/java/jdk1.7.0_79/bin/java -server -Xms8192m -Xmx8192m  -XX:PermSize=512M -XX:MaxNewSize=512m -XX:MaxPermSize=512m -Djava.awt.headless=true  -classpath /export/home/vgop/run/apache-tomcat-6.0.43/bin/bootstrap.jar org.apache.catalina.startup.Bootstrap start

发现java 是带路径的,把路径删除后就正常了。

删除方式:

 vi catalina.sh

:1,%s/"$_RUNJAVA"/java/g

:wq

 

 

 

 

猜你喜欢

转载自java12345678.iteye.com/blog/2209249