Does Tomcat require JDK or JRE?

Solution 1:

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.

Solution 2:

The only notable difference using JDK over JRE is to enable debug mode when launching tomcat jvm.

in the RUNNING.txt we don't have clear distinction, the text deals with certain options, without telling which one :

Using JAVA_HOME provides access to certain additional startup options that are not allowed when JRE_HOME is used.

the information is inside catalina.sh script :

#   JAVA_HOME       Must point at your Java Development Kit installation.
#                   Required to run the with the "debug" argument.

Solution 3:

I did successfully installation of Apache Tomcat 7.0.56 when I installed C:\Program Files (x86)\Java\jre1.8.0_171 .

Additional note: After I did successfully installation of Apache Tomcat 7.0.56 when I installed C:\Program Files (x86)\Java\jre1.8.0_171 I have seen in Java Control Panel -> Desktop Settings:

Web Enabled : checked 
Platform : 1.8 
Product : 1.8.0_171 
Architecture : x86 Type : 
User Path : C:\Program files (86)\Java\jre1.8.0_171\bin\javaw.exe 
Runtime Parametars : (empty field)