No.It is not a bug. JRE by only includes the Java Runtime , it is okay to use it only if you just want to run Java application and nothing more. But to use the JVM debugger feature , you must use JDK which the location is specified by JAVA_HOME
.
catalina.bat start
will only run Tomcat , so JRE is enough.
catalina.bat debug
will enable the debugger and run Tomcat , so JDK is required.
In fact, RUNNING.txt
already explains this behaviour:
(3.2) Set JRE_HOME or JAVA_HOME (required)
These variables are used to specify location of a Java Runtime
Environment or of a Java Development Kit that is used to start Tomcat.
The JRE_HOME variable is used to specify location of a JRE. The
JAVA_HOME variable is used to specify location of a JDK.
Using JAVA_HOME provides access to certain additional startup options
that are not allowed when JRE_HOME is used.
If both JRE_HOME and JAVA_HOME are specified, JRE_HOME is used.
And in the catalina.bat
, it also mentions :
# JAVA_HOME Must point at your Java Development Kit installation.
# Required to run the with the "debug" argument.
#
# JRE_HOME Must point at your Java Runtime installation.
# Defaults to JAVA_HOME if empty. If JRE_HOME and JAVA_HOME
# are both set, JRE_HOME is used.
Also see : What is the difference between JDK and JRE?
Updated on 18-June-2018 :
Real Problem is, if you install JRE and set JRE path as JAVA_HOME
instead of JRE_HOME catalina.bat is able to find the jre path and
starts normally. But, service.bat looks for jre folder inside
JAVA_HOME and fails. if you define JRE_HOME variable, service.bat also
works great.
It is because catalina.bat
will call setclasspath.bat
internally and setclasspath.bat
try to ensure JAVA_HOME
and JRE_HOME
are valid and consistent. In your case , it will set JRE_HOME
to JAVA_HOME
, so catalina.bat
is able to find the JRE path even you did not set JRE_HOME
.
service.bat
have its own checking logic for the JAVA_HOME
/ JRE_HOME
. So , if you want to install JRE only but only set JAVA_HOME
, try to execute setclasspath.bat
before catalina.bat
.