Tomcat的在Linux(CentOS的)。不正确的Java版本 [英] Tomcat on Linux (centos). Incorrect java version

查看:207
本文介绍了Tomcat的在Linux(CentOS的)。不正确的Java版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用yum配置工具的CentOS 5安装Tomcat5的。
我的Java Web应用程序需要Java 1.6没有错误运行。然而,我的tomcat安装出现使用Java 1.4是。当我浏览到Tomcat管理器页面这证实:

I have installed Tomcat5 on CentOS 5 using the yum configuration tool. My java web application requires java 1.6 to run without errors. However, my tomcat install appears to be using java 1.4. This is confirmed when I navigate to the tomcat manager page:

Tomcat Version      JVM Version
Apache Tomcat/5.5.23    1.4.2

在Linux提示符处,当我执行命令:

At the linux prompt, when I execute the command:

java -version

它揭示了:

java version "1.6.0"
OpenJDK  Runtime Environment (build 1.6.0-b09)
OpenJDK 64-Bit Server VM (build 1.6.0-b09, mixed mode)

我modifyied / etc / profile文件和设置JAVA_HOME,JRE_HOME和CATALINA_HOME。当我执行 TOMCAT5版本下面的输出结果:

Using CATALINA_BASE:   /usr/share/tomcat5
Using CATALINA_HOME:   /usr/share/tomcat5
Using CATALINA_TMPDIR: /usr/share/tomcat5/temp
Using JRE_HOME:       /usr/lib/jvm/jre-1.6.0
Server version: Apache Tomcat/5.5.23
Server built:   Jul 27 2009 05:24:08
Server number:  5.5.23.0
OS Name:        Linux
OS Version:     2.6.18-128.1.6.el5
Architecture:   amd64
JVM Version:    1.6.0-b09
JVM Vendor:     Sun Microsystems Inc.

然而,当我启动tomcat并查看服务器信息在JVM仍说:

However, when I start tomcat and view the server information the JVM still says:

 JVM version 1.4.2

任何帮助是AP preciated。

Any help is appreciated.

谢谢,

推荐答案

它看起来像很多人(包括在的CentOS 其他平台)有使用Tomcat的百胜安装的版本麻烦。我尝试安装它自己,倾向于同意 - 它看起来pretty凌乱

It looks like many people (both on CentOS and other platforms) have trouble with the yum-installed version of tomcat. I tried installing it myself, and tend to agree - it looks pretty messy.

与其他人一样在上面的链接,我会建议删除yum的版本,并从 http://tomcat.apache.org直接下载压缩包版本/ 。我用这个方法对我所有的Tomcat的安装(相当频繁),并有几个问题,这一做法。

Like others in the above links, I would recommend removing the yum version and downloading the tarball version straight from http://tomcat.apache.org/. I use this method for all of my tomcat installations (quite frequent), and have had few problems with this approach.

您可以提取压缩包,无论你认为适合您的系统(也许 /选择),并使用 startup.sh <启动它/ code>在斌/ 目录。它应该服从的环境变量比百胜的版本更好,但你也可以设置它们在与应用程序提供的属性文件或脚本中的一个。

You can extract the tarball wherever you deem appropriate for your system (perhaps /opt), and start it up using the startup.sh script in the bin/ directory. It should obey environment variables better than the yum version, but you can also set them in one of the properties files or scripts delivered with the application.

这篇关于Tomcat的在Linux(CentOS的)。不正确的Java版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆