How to find tomcat version installed| check java version used in tomcat


Sometimes, We need to find the tomcat version installed on machine. version.sh or version.bat in bin folder of tomcat folder gives tomcat and java version of machine.

version.sh is for linux and unix OS version.bat is for windows

In this tutorial, Different ways we can check installed tomcat version

Check tomcat version in windows?

First go to installed folder on tomcat home

In my System It is located in B:\apache-tomcat-9.0.35 folder, Go to bin folder

Run version.bat in command line in windows, If you are using in Linux machine, you can use version.sh

B:\apache-tomcat-9.0.35\bin>version.bat
Using CATALINA_BASE:   "B:\apache-tomcat-9.0.35"
Using CATALINA_HOME:   "B:\apache-tomcat-9.0.35"
Using CATALINA_TMPDIR: "B:\apache-tomcat-9.0.35\temp"
Using JRE_HOME:        "A:\Java\jdk1.8.0"
Using CLASSPATH:       "B:\apache-tomcat-9.0.35\bin\bootstrap.jar;B:\apache-tomcat-9.0.35\bin\tomcat-juli.jar"
Server version: Apache Tomcat/9.0.35
Server built:   May 5 2020 20:36:20 UTC
Server number:  9.0.35.0
OS Name:        Windows 10
OS Version:     10.0
Architecture:   amd64
JVM Version:    1.8.0_102-b14
JVM Vendor:     Oracle Corporation

How to find tomcat version in linux/Unix?

First, Check version.sh where is located in unix and linux machine

We can use find command to find the filename=version.sh

sudo find / -name "version.sh"

Output

/usr/local/content/Tomcat/apache-tomcat-8.5.37/bin/version.sh

An other way is to check process information using ps command.

We have to find the tomcat process information using ps command

ps -aef |grep -i tomcat

This will give process id and path of the tomcat installation location

root      7128     1  0 Aug14 ?        00:06:20 /usr/local/java/j2sdk-image//bin/java -Djava.util.logging.config.file=/usr/local//Tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Xms256m -Xmx4096m -XX:MaxPermSize=4096m -XX:OnOutOfMemoryError=/usr/bin/oom-handler -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/usr/local/Tomcat/current/logs/heap-dumps -classpath /usr/local/Tomcat/current/bin/bootstrap.jar:/usr/local/Tomcat/current/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/Tomcat/current -Dcatalina.home=/usr/local/Tomcat/current -Djava.io.tmpdir=/usr/local/Tomcat/current/temp org.apache.catalina.startup.Bootstrap start
user    17624 17470  0 09:21 pts/0    00:00:00 grep --color=auto -i tomcat

Check tomcat running version using lib folder

  • Go to tomcat root folder,
  • cd lib folder
  • Run the below java command java -cp catalina.jar org.apache.catalina.util.ServerInfo
B:\apache-tomcat-9.0.35\lib>java -cp catalina.jar org.apache.catalina.util.ServerInfo
Server version: Apache Tomcat/9.0.35
Server built:   May 5 2020 20:36:20 UTC
Server number:  9.0.35.0
OS Name:        Windows 10
OS Version:     10.0
Architecture:   amd64
JVM Version:    1.8.0_102-b14
JVM Vendor:     Oracle Corporation

How to check tomcat version in JSP file

application scope object has server information

In server.jsp

<%= application.getServerInfo() %>

outputs:

Apache Tomcat/9.0.35.0

Tomcat version check using release notes

Every version of tomcat contains RELEASE-NOTES file, You can check the file by open the file.

With command line, you can run below commands from tomcart root directory In windows

B:\apache-tomcat-9.0.35>type RELEASE-NOTES | find "Apache Tomcat Version"
                     Apache Tomcat Version 9.0.35

In linux

/usr/Tomcat/apache-tomcat-8.5.37$ sudo cat RELEASE-NOTES | grep "Apache Tomcat Version"
                     Apache Tomcat Version 8.5.37
THE BEST NEWSLETTER ANYWHERE
Join 6,000 subscribers and get a daily digest of full stack tutorials delivered to your inbox directly.No spam ever. Unsubscribe any time.

Similar Posts
Subscribe
You'll get a notification every time a post gets published here.