Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does Tomcat require JDK installed? [duplicate]

Tags:

java

tomcat

To my knowledge, JRE is run time and JDK is for development of the Java code. But on the Tomcat server in production, there would be no development of the Java application.

So, my question is why can't we run Tomcat installing only the JRE and why is JDK installation necessary for running Tomcat?

like image 910
Shashikanth Komandoor Avatar asked Oct 07 '15 09:10

Shashikanth Komandoor


2 Answers

Tomcat does not require a JDK. It needs a JRE only. JSP compilation is done by the bundled Eclipse compiler.

like image 59
Michael-O Avatar answered Oct 17 '22 06:10

Michael-O


Because some of the functionality provided by Tomcat is only available in the JDK.

For example, jsp pages must be parsed and any Java code in them must be compiled on-the-fly. This is not a feature available inthe JVM.


Edit

@Michael-O is absolutely right! Tomcat does not require a JDK. See What tomcat requires JDK or JRE? for a fuller explanation.

But note the comment here.

Tomcat 4 requires the full JDK. Tomcat 5.5 onwards will work with a JRE or a JDK.

like image 31
OldCurmudgeon Avatar answered Oct 17 '22 08:10

OldCurmudgeon