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
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:
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.
Once you have started tomcat simply run the following command at a terminal prompt:
ps -ef | grep tomcat
This will show the process details and indicate which JVM (by folder location) is running tomcat.
Or you could use the Probe application and just look at its System Info page. Much easier than writing code, and once you start using it you'll never go back to Tomcat Manager.
You can use the Tomcat manager app to find out which JRE and OS versions Tomcat is using. Given a user
tomcat
with passwordpassword
with a role ofmanager
:Tomcat 6:
Tomcat 7/8:
To find it from Windows OS,
catalina.bat version
It should print jre version details along with other informative details.
Using CATALINA_BASE: "C:\User\software\enterprise-server-tome...
Using CATALINA_HOME: "C:\User\software\enterprise-server-tome...
Using CATALINA_TMPDIR: "C:\User\software\enterprise-server-tome...
Using JRE_HOME: "C:\Program Files\Java\jdk1.8.0_25"
Using CLASSPATH: "C:\User\software\enterprise-server-tome...
Server version: Apache Tomcat/8.5.11
Server built: Jan 10 2017 21:02:52 UTC
Server number: 8.5.11.0
OS Name: Windows 7
OS Version: 6.1
Architecture: amd64
JVM Version: 1.8.0_25-b18
JVM Vendor: Oracle Corporation