Skip to content

Find Tomcat Version When Server is Not Running: Log Files and Static Methods

Purpose

This post demonstrates how to determine Apache Tomcat version when the server is stopped, offline, or cannot be started.

When I tried to troubleshoot a failed Tomcat deployment, I got this problem:

Terminal window
[root@server ~]# systemctl status tomcat
tomcat.service - Apache Tomcat
Loaded: loaded (/etc/systemd/system/tomcat.service; enabled; vendor preset: disabled)
Active: inactive (dead) since Wed 2026-03-26 09:45:00 CST; 5min ago
[root@server ~]# ps aux | grep tomcat
root 12345 0.0 0.0 112808 976 pts/0 S+ 09:50 0:00 grep --color=auto tomcat

The server is completely down. No running process. But I need to know the Tomcat version to troubleshoot a security vulnerability report. The standard method of checking via the manager app won’t work.

Environment

  • Apache Tomcat 10.1.x
  • CentOS 7 / RHEL 8
  • Java 11 or Java 17
  • Systemd service management

What happened?

I was asked to patch a security vulnerability in Tomcat. The vulnerability report specified it affected versions before 10.1.50. I needed to verify the version before applying any patches.

My first instinct was to check the running process:

Terminal window
[root@server ~]# curl http://localhost:8080
curl: (7) Failed to connect to localhost port 8080: Connection refused

The server is down and refuses to start. I tried the standard approach:

Terminal window
[root@server ~]# ./bin/version.sh
Cannot find /opt/tomcat/bin/setclasspath.sh
This file is needed to run this program.

The error suggests an environment issue. But I don’t have time to fix Java paths just to check a version number.

How to solve it?

Method 1: RELEASE-NOTES File (Always Works)

I discovered that Tomcat includes a RELEASE-NOTES file in the root directory. This file is static and always contains the version:

Check RELEASE-NOTES file
[root@server ~]# grep "Apache Tomcat Version" /opt/tomcat/RELEASE-NOTES
Apache Tomcat Version 10.1.52

This method works even if:

  • Tomcat has never been started
  • Java is not installed
  • Environment variables are broken
  • The server is completely broken

The RELEASE-NOTES file is present in every Tomcat distribution and contains the version in plain text.

Method 2: Log Files (Requires Previous Startup)

If Tomcat has been started at least once, the version is logged in catalina.out:

Extract version from catalina.out
[root@server ~]# grep "Starting Servlet engine" /opt/tomcat/logs/catalina.out | tail -1
26-Mar-2026 09:30:15.123 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/10.1.52]

I can extract just the version number:

Extract version number only
[root@server ~]# grep "Starting Servlet engine" /opt/tomcat/logs/catalina.out | tail -1 | grep -oP '\[Apache Tomcat/\K[0-9.]+'
10.1.52

But this method has limitations:

  • Requires Tomcat to have been started at least once
  • Log files might be rotated or deleted
  • Log location varies by configuration

Method 3: version.sh Script (Works Offline)

I fixed the environment issue and found that version.sh actually works without a running server:

Run version.sh script
[root@server ~]# cd /opt/tomcat
[root@server tomcat]# export JAVA_HOME=/usr/lib/jvm/java-11-openjdk
[root@server tomcat]# ./bin/version.sh
Using CATALINA_BASE: /opt/tomcat
Using CATALINA_HOME: /opt/tomcat
Using CATALINA_TMPDIR: /opt/tomcat/temp
Using JRE_HOME: /usr/lib/jvm/java-11-openjdk
Using CLASSPATH: /opt/tomcat/bin/bootstrap.jar:/opt/tomcat/bin/tomcat-juli.jar
Using CATALINA_OPTS:
Server version: Apache Tomcat/10.1.52
Server built: Feb 17 2026 12:34:56 UTC
Server number: 10.1.52.0
OS Name: Linux
OS Version: 4.18.0-348.el8.x86_64
Architecture: amd64
JVM Version: 11.0.22+9-LTS
JVM Vendor: Red Hat, Inc.

Let me verify the server is still stopped:

Verify server is stopped
[root@server tomcat]# systemctl status tomcat
tomcat.service - Apache Tomcat
Active: inactive (dead)
[root@server tomcat]# ./bin/version.sh
Server version: Apache Tomcat/10.1.52
# Still works!

The version.sh script doesn’t start the server. It just queries the catalina.jar for version information.

Method 4: Query catalina.jar Directly

I can also query the JAR file directly without any scripts:

Query catalina.jar directly
[root@server ~]# java -cp /opt/tomcat/lib/catalina.jar org.apache.catalina.util.ServerInfo
Server version: Apache Tomcat/10.1.52
Server built: Feb 17 2026 12:34:56 UTC
Server number: 10.1.52.0
OS Name: Linux
OS Version: 4.18.0-348.el8.x86_64
Architecture: amd64
JVM Version: 11.0.22+9-LTS
JVM Vendor: Red Hat, Inc.

This method requires Java to be installed but doesn’t need Tomcat running.

The Reason

I think the key insight is that Tomcat version information is stored in multiple static locations, not just in the running process. Here’s why each method works:

  1. RELEASE-NOTES: A static text file included in every distribution. It’s the first place I check because it requires no dependencies.

  2. Log files: Tomcat logs its version on every startup. If the server has ever run, the version is recorded.

  3. version.sh and catalina.jar: These work because they read metadata from the JAR files, not from a running process.

The common mistake is assuming Tomcat must be running to check the version. In fact, all version information is available in static files.

Comprehensive Offline Version Check Script

I created a script that tries all methods in order of reliability:

check-tomcat-version.sh
#!/bin/bash
# Check Tomcat version when server is not running
# Usage: ./check-tomcat-version.sh [tomcat_home]
TOMCAT_HOME="${1:-/opt/tomcat}"
echo "=== Checking Tomcat version (server may be stopped) ==="
echo "Tomcat home: $TOMCAT_HOME"
echo ""
# Method 1: RELEASE-NOTES (always works, no dependencies)
echo "Method 1: RELEASE-NOTES file"
if [ -f "$TOMCAT_HOME/RELEASE-NOTES" ]; then
grep "Apache Tomcat Version" "$TOMCAT_HOME/RELEASE-NOTES"
echo "Status: SUCCESS (most reliable method)"
else
echo "Status: FAILED - RELEASE-NOTES not found"
fi
echo ""
# Method 2: version.sh script (requires JAVA_HOME)
echo "Method 2: version.sh script"
if [ -x "$TOMCAT_HOME/bin/version.sh" ]; then
if [ -n "$JAVA_HOME" ]; then
"$TOMCAT_HOME/bin/version.sh" 2>/dev/null | grep "Server version"
if [ $? -eq 0 ]; then
echo "Status: SUCCESS"
else
echo "Status: FAILED - check JAVA_HOME"
fi
else
echo "Status: SKIPPED - JAVA_HOME not set"
fi
else
echo "Status: FAILED - version.sh not found or not executable"
fi
echo ""
# Method 3: Log files (requires previous startup)
echo "Method 3: Log files (catalina.out)"
if [ -f "$TOMCAT_HOME/logs/catalina.out" ]; then
grep "Starting Servlet engine" "$TOMCAT_HOME/logs/catalina.out" | tail -1
echo "Status: SUCCESS (requires at least one previous startup)"
else
echo "Status: FAILED - catalina.out not found"
fi
echo ""
# Method 4: catalina.jar (requires Java)
echo "Method 4: Query catalina.jar directly"
if [ -f "$TOMCAT_HOME/lib/catalina.jar" ]; then
if [ -n "$JAVA_HOME" ]; then
"$JAVA_HOME/bin/java" -cp "$TOMCAT_HOME/lib/catalina.jar" \
org.apache.catalina.util.ServerInfo 2>/dev/null | grep "Server version"
if [ $? -eq 0 ]; then
echo "Status: SUCCESS"
else
echo "Status: FAILED - check Java installation"
fi
else
echo "Status: SKIPPED - JAVA_HOME not set"
fi
else
echo "Status: FAILED - catalina.jar not found"
fi

Sample output:

Script output example
[root@server ~]# ./check-tomcat-version.sh /opt/tomcat
=== Checking Tomcat version (server may be stopped) ===
Tomcat home: /opt/tomcat
Method 1: RELEASE-NOTES file
Apache Tomcat Version 10.1.52
Status: SUCCESS (most reliable method)
Method 2: version.sh script
Server version: Apache Tomcat/10.1.52
Status: SUCCESS
Method 3: Log files (catalina.out)
26-Mar-2026 09:30:15.123 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/10.1.52]
Status: SUCCESS (requires at least one previous startup)
Method 4: Query catalina.jar directly
Server version: Apache Tomcat/10.1.52
Status: SUCCESS

Summary

In this post, I showed four methods to find Tomcat version when the server is not running. The key insight is that version information is stored in static files, not just in running processes.

Recommended approach:

  1. Check RELEASE-NOTES first (no dependencies, always available)
  2. Use version.sh if Java is configured (works offline)
  3. Check logs if server has run before
  4. Query catalina.jar directly as a fallback

Common mistakes to avoid:

  • Assuming Tomcat must be running to check version
  • Forgetting to set JAVA_HOME for version.sh
  • Searching wrong log directory
  • Overlooking the simple RELEASE-NOTES file

Final Words + More Resources

My intention with this article was to help others share my knowledge and experience. If you want to contact me, you can contact by email: Email me

Here are also the most important links from this article along with some further resources that will help you in this scope:

Oh, and if you found these resources useful, don’t forget to support me by starring the repo on GitHub!

Comments