How to check Tomcat version Installed
To find out the Tomcat version, find this file – version.sh
for *nix or version.bat
for Windows. This version.sh
file is normally located in the Tomcat bin folder.
For example :
mkyong@hcompass:/usr/share/tomcat7/bin$ ./version.sh
Using CATALINA_BASE: /usr/share/tomcat7
Using CATALINA_HOME: /usr/share/tomcat7
Using CATALINA_TMPDIR: /usr/share/tomcat7/temp
Using JRE_HOME: /usr
Using CLASSPATH: /usr/share/tomcat7/bin/bootstrap.jar:/usr/share/tomcat7/bin/tomcat-juli.jar
Server version: Apache Tomcat/7.0.28
Server built: Apr 8 2014 08:47:08
Server number: 7.0.28.0
OS Name: Linux
OS Version: 3.15.4-x86_64-linode45
Architecture: amd64
JVM Version: 1.7.0_55-b14
JVM Vendor: Oracle Corporation
In this example, Tomcat version is 7.0.28
Note
If you are not sure where is the version.sh
file, try this command :
sudo find / -name "version.sh"
Find out everything about Tomcat.
sudo find / -name "tomcat7"
Worth a try with our rather customised installation!
tomcat@srv1:~/i/root/bin$ export JAVA_HOME=/usr/lib/jvm/jre-1.6.0-sun.x86_64
tomcat@srv1:~/i/root/bin$ ./version.sh
Using CATALINA_BASE: /a/tomcat/i/root
Using CATALINA_HOME: /a/tomcat/
Using CATALINA_TMPDIR: /a/tomcat/i/root/temp
Using JRE_HOME: /usr/lib/jvm/jre-1.6.0-sun.x86_64/
Using CLASSPATH: /a/tomcat/i/root/bin/tomcat-juli.jar:/srv/tomcat//bin/bootstrap.jar
Exception in thread “main” java.lang.NoClassDefFoundError: org/apache/catalina/util/ServerInfo
Caused by: java.lang.ClassNotFoundException: org.apache.catalina.util.ServerInfo
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: org.apache.catalina.util.ServerInfo. Program will exit.
Follow the below path
/usr/local/apache-tomcat-6.0.18/bin/version.sh
Will give below result:
Using CATALINA_BASE: /usr/local/apache-tomcat-6.0.18
Using CATALINA_HOME: /usr/local/apache-tomcat-6.0.18
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-6.0.18/temp
Using JRE_HOME: /usr/java/jdk1.6.0_10
Server version: Apache Tomcat/6.0.18
Server built: Jul 22 2008 02:00:36
Server number: 6.0.18.0
OS Name: Linux
OS Version: 2.6.9-55.ELsmp
Architecture: i386
JVM Version: 1.6.0_10-rc-b28
JVM Vendor: Sun Microsystems Inc.
Thanks for your tip ~
Here i didnt get the tomcat verion with this paths
Linux: java -cp lib/catalina.jar org.apache.catalina.util.ServerInfo
Windows: java.exe -cp lib\catalina.jar org.apache.catalina.util.ServerInfo
Thanks for the information. This is helpful.
Hi,
Is there a tool available to identify the version we are using. I am upgrading the application to the latest TOMCAT version but just want to know if any of the older files are used or not. Can you provide some pointers to this?
try writing a python/bash script to find all the tomcat version installed in your host
Thanks for the information. This is helpful.
MK Yong, your tomcat and hibernate tutorials have been invaluable to me. Thanks man!
Thanks Mkyong,
How about in Windows envirunment? what is the command to know the TOMCAT version?
Thanks in advance
NABIL
Try parsing or executing the Tomcat_home/bin directory and look for a script named “version.sh” OR “version.bat” depending on your operating system.For windows its “version.bat”..