简体   繁体   English

如何使用64位Java JDK为Solaris Sparc 64位构建Tomcat原生

[英]How to build Tomcat-native for Solaris Sparc 64 bit using 64-bit Java JDK

I'm using Solaris Sparc 64 bit machine. 我正在使用Solaris Sparc 64位计算机。 I want to build Tomcat native using 64 bit version of Java. 我想使用64位版本的Java构建Tomcat本机。 I installed Java in my Solaris box according to JDK 7 Installation on the Oracle Solaris Operating System . 我根据Oracle Solaris操作系统上的JDK 7安装在 Solaris框中安装了Java。

When i check the version of Java: 当我检查Java版本时:

/usr/jdk/jdk1.7.0_80/bin/java -version
java version "1.7.0_80"
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) Server VM (build 24.80-b11, mixed mode)

I also export JAVA_HOME : 我也导出JAVA_HOME

export JAVA_HOME=/usr/jdk/jdk1.7.0_80

I configure with: 我配置:

./configure --with-apr=/usr/local/apr/bin/apr-1-config --with-java-home=$JAVA_HOME \
--with-ssl=/usr/local/ssl --prefix=$CATALINA_HOME

I am able to build using this java 32 bit but 64 bit java is there in: 我可以使用此32位Java构建,但其中包含64位Java:

/usr/jdk/jdk1.7.0_80/bin/sparcv9/java -version
java version "1.7.0_80"
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)

How do I tell my Tomcat-native configure to use 64 bit java instead of 32 bit java? 如何告诉我的Tomcat本地配置使用64位Java而不是32位Java?


The issue is here is I can build with 32 bit java and tomcat will work. 问题在这里是我可以使用32位Java进行构建,并且tomcat可以工作。 but in production there is no 32 bit JRE only 64 bit JRE is there. 但是在生产中没有32位JRE,只有64位JRE。 If I use the same 32 bit Tomcat-native library it results in: 如果我使用相同的32位Tomcat本机库,则会导致:

wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch)]

Update #1 更新#1

INFO: Loaded APR based Apache Tomcat Native library 1.1.33 using APR version 1.5.2.
Dec 12, 2015 8:02:42 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
Dec 12, 2015 8:02:42 PM org.apache.catalina.core.AprLifecycleListener initializeSSL
INFO: OpenSSL successfully initialized (OpenSSL 1.0.1p 9 Jul 2015)
Dec 12, 2015 8:02:43 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-apr-0.0.0.0-8081"]
Dec 12, 2015 8:02:43 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-apr-0:0:0:0:0:0:0:0-8081"]
Dec 12, 2015 8:02:43 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-apr-0.0.0.0-8444"]
ld.so.1: java: fatal: relocation error: file /tomcat7/lib/libtcnative-1.so.0.1.33: symbol EC_KEY_new_by_curve_name: referenced symbol not found

APR, 年利率

 CFLAGS="-m64" ./configure

TC-native, TC原生

 CFLAGS="-m64" ./configure --with-apr=/usr/local/apr/bin/apr-1-config --with-java-home=/usr/jdk/instances/jdk1.7.0/ --with-ssl=/usr/local/ssl --prefix=/tomcat7

Worked!! 工作了! ----------------------------------------------------------------------- -------------------------------------------------- ---------------------

build openssl, 构建openssl,

export KERNEL_BITS=64
./config shared
make 
make install

Build APR 建立APR

CC="cc" CFLAGS="-m64" LDFLAGS="-m64" ./configure
make
make install

Build tc-native 建立本机

CC="cc" CFLAGS="-m64 -fPIC" LDFLAGS="-m64" ./configure --with-apr=/usr/local/apr/bin/apr-1-config --with-java-home=/usr/jdk/jdk1.7.0_80/ --with-ssl=/usr/local/ssl --prefix=/tomcat
make 
make install

There doesn't look to be an option to specify a 64 bit sparc target. 似乎没有指定64位sparc目标的选项。

Perhaps the build system would figure it by itself from the compiler flags. 也许构建系统会从编译器标志中自行解决它。

I would try: 我会尝试:

CFLAGS="-m 64" ./configure ...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM