Tomcat: How to find out running tomcat version

前端 未结 27 1783
臣服心动
臣服心动 2020-11-30 16:18

I\'m trying to get Appfuse + tomcat + jRebel working.

Appfuse by default uses Cargo to download tomcat (ver. 7.0.33) and deploy the application to it. I wish to use

相关标签:
27条回答
  • 2020-11-30 16:53

    In Unix-like environments, I also recommend checking the actual running process command line:

    $ ps aux | grep java
    
    ...
    /usr/lib/jvm/java-8-openjdk-amd64/bin/java -Djava.util.logging.config.file=/srv/tomcat-instances/bla/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.awt.headless=true -Xmx4096M -XX:+UseConcMarkSweepGC -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n -Xmx4096m -Xms4096m -XX:MaxPermSize=2048m -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=8090 -Dcom.sun.management.jmxremote.rmi.port=8090 -Djava.rmi.server.hostname=localhost -Djava.endorsed.dirs=/opt/apache-tomcat-8.0.47/endorsed -classpath /opt/apache-tomcat-8.0.47/bin/bootstrap.jar:/opt/apache-tomcat-8.0.47/bin/tomcat-juli.jar -Dcatalina.base=/srv/tomcat-instances/bla -Dcatalina.home=/opt/apache-tomcat-8.0.47 -Djava.io.tmpdir=/tmp/tomcat8-bla-tmp org.apache.catalina.startup.Bootstrap start
    ...
    

    One can run on subtle weird behaviors due to (operating system) environment variables and (Java) system properties being set to unexpected values. I had a situation where due to an outdated Tomcat setenv.sh, A Tomcat 8 started with classes from a Tomcat 7 on the classpath. Make sure that in the process command line options such as -Dcatalina.base, -Dcatalina.home and -classpath make sense.

    0 讨论(0)
  • 2020-11-30 16:53

    You can find out the server information through its status page:

    {running-tomcat-url}/manager/status
    

    On that page you can see the version of Java on which your Tomcat runs

    Note: I have also pasted this answer on Tomcat6 and JRE7 compatibility issue. Unsupported major.minor version 51.0

    0 讨论(0)
  • 2020-11-30 16:54

    The version of currently running Tomcat

    If you set the environtment variable - %CATALINA_HOME%, then Windows :

    >> cd %CATALINA_HOME%\bin
    >> version
    

    Alternatively,

    java.exe -cp lib\catalina.jar org.apache.catalina.util.ServerInfo
    

    MY SETTING --- Hope yours will be similar to as follows

    %CATALINA_HOME% --- C:\Program Files\Tomcat\apache-tomcat-8.0.28
    

    OUTPUT

    Server version: Apache Tomcat/8.0.28 Server built: Oct 7 2015 18:25:21 UTC Server number: 8.0.28.0 OS Name: Windows 7 OS Version: 6.1 Architecture: amd64 JVM Version: 1.8.0_111-b14 JVM Vendor: Oracle Corporation

    0 讨论(0)
  • 2020-11-30 16:54

    To know exact tomcat version alone, just visit vi tomcat/BUILDING.txt

    0 讨论(0)
  • 2020-11-30 16:55

    run on terminal of the Unix server

    w3m http://localhost:8080/
    

    to quit press q and next y

    0 讨论(0)
  • 2020-11-30 16:58

    if you can upload a JSP file you may print out some info like in this example: bestdesigns.co.in/blog/check-jsp-tomcat-version

    Save this code into a file called tomcat_version.jsp:

        Tomcat Version : <%= application.getServerInfo() %><br>    
        Servlet Specification Version : 
    <%= application.getMajorVersion() %>.<%= application.getMinorVersion() %> <br>    
        JSP version :
    <%=JspFactory.getDefaultFactory().getEngineInfo().getSpecificationVersion() %><br>
    

    When you access, http://example.com/tomcat_version.jsp, the output should look similar to:

    Tomcat Version : Apache Tomcat/5.5.25
    Servlet Specification Version : 2.4
    JSP version: 2.0
    
    0 讨论(0)
提交回复
热议问题