tomcat java版本,我如何找到Tomcat6正在使用的Java版本?

Is there a OS command to find what Java version Tomcat6 is using?

I need to use a Perl (including system()) command.

I using Linux. Ubuntu and CentOS

Is there something like?

tomcat6 version

解决方案

At first you need to understand first, that Tomcat is a Java application.

So, to see which java version Tomcat is using, you can just simply find the script file from which Tomcat is started, usually catalina.sh.

Inside this file, you will get something like below:

catalina.sh:# JAVA_HOME Must point at your Java Development Kit installation.

catalina.sh:# Defaults to JAVA_HOME if empty.

catalina.sh: [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`

catalina.sh: JAVA_HOME=`cygpath --absolute --windows "$JAVA_HOME"`

catalina.sh: echo "Using JAVA_HOME: $JAVA_HOME"

By default, JAVA_HOME should be empty, which mean it will use the default version of java, or you can test with: echo $JAVA_HOME

And then use "java -version" to see which version you default java is.

And vice versa by setting this property: JAVA_HOME, you can configure which Java version to use when starting Tomcat.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值