Starting startup. bat from the bin directory of Tomcat results in a flash of Tomcat, leaving a gorgeous figure. Why? Let's first look at Tomcat's startup. bat, which calls Catalina. bat, While Catalina. Bat calls setclasspath. bat. You only need to declare the environment variables at the beginning of setclasspath. bat. For example, my environment variables are:
Let's talk about a tomcat problem first. When you see a startup. bat in the bin, execute the command. The result is displayed.
Neither the java_home nor the jre_home environment variable is defined at least one of these environment variable is needed to run this program
The reason is that the environment variables java_home and jre_home will not be automatically registered after later versions are installed.
Let's first look at Tomcat's startup. bat, which calls Catalina. bat, While Catalina. Bat calls setclasspath. bat. You only need to declare the environment variable at the beginning of setclasspath. BAT (two rows in red). For example, mine is:
You only need to declare the environment variables at the beginning of setclasspath. bat. For example, my environment variables are:
Rem ---------------------------------------------------------------------------
Rem set classpath and Java options
Rem
Rem $ ID: setclasspath. Bat 505241 10: 22: 58z jfclere $
Rem ---------------------------------------------------------------------------
Set java_home = c: \ Program Files \ Java \ jdk1.6.0 _ 20
Set jre_home = c: \ Program Files \ Java \ jre6
REM make sure prerequisite environment variables are set
if not" % java_home % "=" Goto gotjdkhome
if not" % jre_home % "=" "Goto gotjrehome
echo neither the java_home nor the jre_home environment variable is defined
echo at least one of these environment variable is needed to run this program
goto exit
......
In this way, java_home and jre_home are automatically registered every time you run startup. bat.
Run startup. bat and the message "message: server startup in XXXXX ms" is displayed.