There are three ways of determining the installed version of Tomcat:
To verify the installed version of Tomcat, execute the version script. This script is included with the standard Tomcat installation. To execute this script:
bin
directory of the installation, then run this script: version.bat
. version.sh
. This script reports this information:
CATALINA_BASE
CATALINA_HOME
CATALINA_TMPDIR
JRE_HOME
CLASSPATH
Server Version
Server Build Date
OS Name
OS Version
Architecture
JVM Version
JVM Vendor
Example:
Using CATALINA_BASE: "C:\development\servers\apache-tomcat-6.0.32"
Using CATALINA_HOME: "C:\development\servers\apache-tomcat-6.0.32"
Using CATALINA_TMPDIR: "C:\development\servers\apache-tomcat-6.0.32\temp"
Using JRE_HOME: "C:\Program Files\Java\jdk1.6.0_24"
Using CLASSPATH: "C:\development\servers\apache-tomcat-6.0.32\bin\bootstrap.jar"
Server version: Apache Tomcat/6.0.32
Server built: February 2 2011 2003
Server number: 6.0.32.0
OS Name: Windows XP
OS Version: 5.1
Architecture: x86
JVM Version: 1.6.0_24-b07
JVM Vendor: Sun Microsystems Inc.
If you do not have the script, or if it fails, use the ServerInfo class that is included with Tomcat. The class contains a Java main function, and can be executed with this command:java -cp lib/catalina.jar org.apache.catalina.util.ServerInfo
This command generates this information:
Server Version
Server Build Date
OS Name
OS Version
Architecture
JVM Version
JVM Vendor
Example:
Server version: Apache Tomcat/6.0.32
Server built: February 2 2011 2003
Server number: 6.0.32.0
OS Name: Windows XP
OS Version: 5.2
Architecture: amd64
JVM Version: 1.6.0_19-b04
JVM Vendor: Sun Microsystems Inc.
It is also possible to retrieve the server information at programatically or at runtime, using the org.apache.catalina.util.ServerInfo
class. To do so, call one of these functions:
getServerInfo
returns a string that represents the version. For example, Apache Tomcat/6.0.32
. getServerBuilt
returns a string that represents the server build date. For example, February 2 2011
. getServerNumber
returns a string that represents the server's version number. For example, 6.0.32.0
.