Tomcat提供了一个查询自身版本号的方法,要查询Tomcat的版本号,必须知道Tomcat所在的准确目录。在Mac系统下,Tomcat一般安装在/Library/Tomcat/bin。
打开终端(Terminal),输入命令:sh /Library/Tomcat/bin/catalina.sh version
返回信息如下:
Using CATALINA_BASE: /Library/Tomcat
Using CATALINA_HOME: /Library/Tomcat
Using CATALINA_TMPDIR: /Library/Tomcat/temp
Using JRE_HOME: /Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home
Using CLASSPATH: /Library/Tomcat/bin/bootstrap.jar:/Library/Tomcat/bin/tomcat-juli.jar
Server version: Apache Tomcat/7.0.69
Server built: Apr 11 2016 07:57:09 UTC
Server number: 7.0.69.0
OS Name: Mac OS X
OS Version: 10.11.6
Architecture: x86_64
JVM Version: 1.8.0_91-b14
JVM Vendor: Oracle Corporation
可以看到Apache Tomcat版本号是7.0.69