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:
[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 tomcatroot 12345 0.0 0.0 112808 976 pts/0 S+ 09:50 0:00 grep --color=auto tomcatThe 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:
[root@server ~]# curl http://localhost:8080curl: (7) Failed to connect to localhost port 8080: Connection refusedThe server is down and refuses to start. I tried the standard approach:
[root@server ~]# ./bin/version.shCannot find /opt/tomcat/bin/setclasspath.shThis 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:
[root@server ~]# grep "Apache Tomcat Version" /opt/tomcat/RELEASE-NOTES Apache Tomcat Version 10.1.52This 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:
[root@server ~]# grep "Starting Servlet engine" /opt/tomcat/logs/catalina.out | tail -126-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:
[root@server ~]# grep "Starting Servlet engine" /opt/tomcat/logs/catalina.out | tail -1 | grep -oP '\[Apache Tomcat/\K[0-9.]+'10.1.52But 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:
[root@server ~]# cd /opt/tomcat[root@server tomcat]# export JAVA_HOME=/usr/lib/jvm/java-11-openjdk[root@server tomcat]# ./bin/version.shUsing CATALINA_BASE: /opt/tomcatUsing CATALINA_HOME: /opt/tomcatUsing CATALINA_TMPDIR: /opt/tomcat/tempUsing JRE_HOME: /usr/lib/jvm/java-11-openjdkUsing CLASSPATH: /opt/tomcat/bin/bootstrap.jar:/opt/tomcat/bin/tomcat-juli.jarUsing CATALINA_OPTS:Server version: Apache Tomcat/10.1.52Server built: Feb 17 2026 12:34:56 UTCServer number: 10.1.52.0OS Name: LinuxOS Version: 4.18.0-348.el8.x86_64Architecture: amd64JVM Version: 11.0.22+9-LTSJVM Vendor: Red Hat, Inc.Let me verify the server is still stopped:
[root@server tomcat]# systemctl status tomcat● tomcat.service - Apache Tomcat Active: inactive (dead)
[root@server tomcat]# ./bin/version.shServer 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:
[root@server ~]# java -cp /opt/tomcat/lib/catalina.jar org.apache.catalina.util.ServerInfoServer version: Apache Tomcat/10.1.52Server built: Feb 17 2026 12:34:56 UTCServer number: 10.1.52.0OS Name: LinuxOS Version: 4.18.0-348.el8.x86_64Architecture: amd64JVM Version: 11.0.22+9-LTSJVM 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:
-
RELEASE-NOTES: A static text file included in every distribution. It’s the first place I check because it requires no dependencies.
-
Log files: Tomcat logs its version on every startup. If the server has ever run, the version is recorded.
-
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:
#!/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"fiecho ""
# 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" fielse echo "Status: FAILED - version.sh not found or not executable"fiecho ""
# 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"fiecho ""
# 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" fielse echo "Status: FAILED - catalina.jar not found"fiSample output:
[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.52Status: SUCCESS (most reliable method)
Method 2: version.sh scriptServer version: Apache Tomcat/10.1.52Status: 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 directlyServer version: Apache Tomcat/10.1.52Status: SUCCESSSummary
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:
- Check RELEASE-NOTES first (no dependencies, always available)
- Use version.sh if Java is configured (works offline)
- Check logs if server has run before
- 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