Q. How do I find the installed Tomcat version on a Linux system?
Tomcat installation provides an shell script version.sh for the Linux-based systems and version.bat for Windows systems. This script provides detailed information about the Tomcat version and other details. This quick blog post will help you to find the Tomcat version installed on your system.
Check Tomcat Version
- Use the cd command to switch to the Tomcat installation bin directory. The location of the directory depends on the installation types. The packages installed on the official repository are generally installed under the /etc/tomcat directory. Custom installation is generally done under the /opt or /usr/share directory.
cd /usr/share/tomcat/bin
Note: If you still have not found the directory, I have discussed a few methods at the end of this article.
- You will find a version.sh script under the bin directory. You can execute this script to find the installed Tomcat version along with a few other details.
./version.sh
Using CATALINA_BASE: /usr/share/tomcat Using CATALINA_HOME: /usr/share/tomcat Using CATALINA_TMPDIR: /usr/share/tomcat/temp Using JRE_HOME: /usr Using CLASSPATH: /usr/share/tomcat/bin/bootstrap.jar:/usr/share/tomcat/bin/tomcat-juli.jar Using CATALINA_OPTS: Server version: Apache Tomcat/10.0.23 Server built: Jul 14 2022 08:16:11 UTC Server number: 10.0.23.0 OS Name: Linux OS Version: 5.15.0-47-generic Architecture: amd64 JVM Version: 17.0.1+12-LTS-39 JVM Vendor: Oracle Corporation
Here is the screenshot of the Tomcat version running on a Ubuntu 22.04 system. I have recently installed it from the source code.
Note: If you don’t know the installation directory. You can try the following commands to find it.
find / -type d -name "*tomcat*"
find / -type f -name version.sh
Conclusion
It’s a good practice to keep servers up to date. You may also need to check the currently installed Tomcat version to find if a newer version is available. This blog post will help you to find the Tomcat version via the command line interface.