Pivotal Knowledge Base

Follow

Verifying the installed version of Tomcat (2000579)

Verifying the installed version of Tomcat (2000579)

Purpose

This article provides information on verifying the version of Tomcat installed in your system.

Resolution

There are three ways of determining the installed version of Tomcat:

  1. The version script
  2. The ServerInfo class
  3. Programatically

The version script

To verify the installed version of Tomcat, execute the version script. This script is included with the standard Tomcat installation. To execute this script:

  1. Open a command prompt. For more information, see Opening a command or shell prompt (1003892).
  2. Navigate to the bin directory of the installation, then run this script:

    1. Windows: version.bat.
    2. Linux: 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.

The ServerInfo class

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.

Programatically

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.

Tags

verify-tomcat-version

See Also

This Article Replaces

1033932

Update History

07/05/2011 - Reorganized information into sections for clarity, added distinguishing information
©VMware 2013

Comments

Powered by Zendesk