Main Tutorials

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"

About Author

author image
Founder of Mkyong.com, love Java and open source stuff. Follow him on Twitter. If you like my tutorials, consider make a donation to these charities.

Comments

Subscribe
Notify of
12 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
Kate
12 years ago

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.

Vikas Gupta
14 years ago

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.

Shanthi
1 year ago

Here i didnt get the tomcat verion with this paths

Akash Chatterjee
3 years ago

Linux: java -cp lib/catalina.jar org.apache.catalina.util.ServerInfo

Windows: java.exe -cp lib\catalina.jar org.apache.catalina.util.ServerInfo

Niluka
5 years ago

Thanks for the information. This is helpful.

Garima Jain
7 years ago

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?

AMIT KUMAR PATTNAIK
5 years ago
Reply to  Garima Jain

try writing a python/bash script to find all the tomcat version installed in your host

Sandeep
10 years ago

Thanks for the information. This is helpful.

Noah Freedman
10 years ago

MK Yong, your tomcat and hibernate tutorials have been invaluable to me. Thanks man!

NABIL Aal
11 years ago

Thanks Mkyong,

How about in Windows envirunment? what is the command to know the TOMCAT version?

Thanks in advance
NABIL

kamlesh
10 years ago
Reply to  NABIL Aal

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”..