2 Minutes To Code (β Version)

Apache Tomcat - 2 minute tutorial

Jre not configured : How to troubleshoot jdk/jre missing issue

If you are double-clicking startup.bat or startup.sh and a console opens & crashes immediately, then the most likely reason of failure is that tomcat was not able to find a jdk or a jre.

To confirm this, open a command prompt, cd to %TOMCAT_HOME%\bin and run startup.bat in case of windows machine. In case of linux machines, open a shell prompt, cd to $TOMCAT_HOME/bin folder and run startup.sh. If jdk/jre path is not configured, appropriate message will be displayed on the console as shown in the image below.

To fix this, just set JDK_HOME in the environment variable or in %TOMCAT_HOME%\bin\catalina.bat or $TOMCAT_HOME/bin/catalina.sh file to the jdk folder on your server.