Does Tomcat require JDK or JRE?

前端 未结 4 720
不知归路
不知归路 2020-12-05 04:25

I\'ve read many articles and posts related to Tomcat and the Java runtime. I am confused and need help. Can anybody clear my doubt regarding whether Tomcat requires JDK or J

4条回答
  •  一向
    一向 (楼主)
    2020-12-05 04:34

    Tomcat's RUNNING.txt which you can find in the root of the bundle states that Apache Tomcat requires Java Standard Edition Runtime Environment (JRE) to run. Minimum version of JRE depends on the version of Tomcat: for Tomcat 6.0 it is Java 5, for Tomcat 7.0 - Java 6.

    However you can also use JDK because, as you probably know, it includes JRE (link). The only difference is in the configuration of environment variables. If you use JRE you should set JRE_HOME, if JDK - JAVA_HOME. Read RUNNING.txt for more details.

    P.S. Web containers may require JDK in order to support JSP, because Java Compiler is required to compile Servlets which are generated from *.jsp files. Tomcat has Eclipse Java Compiler bundle so it can run on JRE and still support JSP.

提交回复
热议问题