Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can JRE be enough for Tomcat to handle JSP files? Why not JDK?

Can someone clearly describe how JRE handles the JSP files which contain pure JAVA codes? I know that byte codes of JSP files are not placed in the WAR file. It consists of compiled CLASS files and plain JSP files.

It says in Tomcat's RUNNING.txt "Apache Tomcat 6.0 requires the Java 2 Standard Edition Runtime Environment (JRE) version 5.0 or later."

Please kill my pain.

like image 259
vhtmg108 Avatar asked Jun 28 '10 13:06

vhtmg108


People also ask

Does Tomcat require JRE or JDK?

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.

Can JSP run on Tomcat?

you can use Tomcat(has jsp container in it) to run your jsp. Show activity on this post. You need servlet container, connector component and the JSP engine to run JSP pages. In case of tomcat, Catalina is actually the servlet container.

How does Tomcat compile JSP?

The first time a JSP page is requested, Tomcat passes it to Jasper which parses the code and sends it to its Java compiler (JDT, a component borrowed from the Eclipse IDE project) to have the servlet elements compiled into Java bytecode classes.

Where do I put JSP files in Tomcat?

Add a JSP extension to the file name -- for example, "filename. jsp" -- and click "Save." Put it at location C:\apache-tomcat-7.0. 28\webapps\ROOT.


1 Answers

Tomcat bundles a copy of the Eclipse compiler, rather than using the JDK javac compiler. It's faster (or, at least, it used to be), has less restrictive licensing, and removes the dependency on the full JDK.

http://tomcat.apache.org/tomcat-5.5-doc/jasper-howto.html

The Eclipse JDT Java compiler is now used to perform JSP java source code compilation

This suggests that prior to Tomcat 5.5, the full JDK was required.

like image 150
skaffman Avatar answered Oct 17 '22 01:10

skaffman