The CATALINA_HOME environment variable is not defined correctly.This environment variable is needed

Tomcat start of this mistake start.bat Times

Environment variable CATALINA_HOME IS not at The defined correctly.This Environment variable IS needed to RUN the this Program
1
This problem usually occurs in CATALINA_HOME, JAVA_HOME environment variable configuration errors, such as the end of the path contain extra symbols such as; \, please check.

Environment variables configured as follows: 
name: the JAVA_HOME 
value: C: \ jdk1.6.0_31 (modified path according to the actual situation) 
 
;%% the JAVA_HOME \ bin;%% the JAVA_HOME \ JRE \ bin 


And I had to configure this together when trying to modify many times, the final confirmation is no problem, but still error. Need to set the file fragments in CATALINA_HOME start.bat file, add this line:

= D CATALINA_HOME the SET: \ the Apache-Tomcat 
 
CATALINA_HOME environment variable configuration before it can be deleted.

This step is to set the CATALINA_HOME environment variable, below it is to determine whether CATALINA_HOME empty statement. If you find the exact location, simply set the environment variable CATALINA_HOME this code into the first line of the file. JAVA_HOME environment variable is set in the same manner may be employed. However, if you want to use shutdown.bat in another directory to shut down Tomcat server, you need to set the CATALINA_HOME and JAVA_HOME environment variables in these two shutdown.bat file, the same set of variables startup.bat file location and are judged CATALINA_HOME whether before empty. Of course, in order to once and for all, to avoid even after reinstall Tomcat settings (requires the same version of Tomcat installed in the same location), we'd better add two CATALINA_HOME and JAVA_HOME environment variables to the environment variable system.

Some readers may have Tomcat installation directory name of the environment variable CATALINA_HOME and is surprised, according to the settings view other environment variables, JAVA_HOME represents the JDK installation directory, you should use TOMCAT_HOME to represent the installation directory of Tomcat, but why should CATALINA_HOME use it? In fact, in previous Tomcat 4, is used to represent TOMCAT_HOME installation directory of Tomcat, after Tomcat 4, adopted a new Servlet container Catalina, so the name was changed to the environment variable CATALINA_HOME.

In the Windows system environment variable name is case-insensitive, that is, JAVA_HOME and java_home is the same.

Other related: 
with a text editor to open the tool for batch file startup.bat start Tomcat, and read it carefully. In this document, first determine whether the CATALINA_HOME environment variable is empty, if empty, the current directory will be set to the value of CATALINA_HOME. Then determine whether there is bin \ catalina.bat the current directory, if the file does not exist, the parent directory of the current directory is set to the value CATALINA_HOME. According to the author machine Tomcat installation directory hierarchy, the final value CATALINA_HOME is set to the installation directory of Tomcat. If the environment variable CATALINA_HOME already exists, this environment variable by calling "catalina.bat start" command in the bin directory. Through this analysis, we learned that two pieces of information, when one is starting Tomcat, CATALINA_HOME environment variables need to find, if you call startup.bat in Tomcat's bin directory, Tomcat will automatically set the CATALINA_HOME and correct; the second is the implementation of startup. bat command is actually executed is "catalina.bat start" command.

If we are not calling startup.bat in Tomcat's bin directory as the current directory, the error message shown below (except for calls in the parent directory bin directory) will appear. 
 
So this is actually a second election issue, either configure the environment variables, or modify start.bat configuration. 
Related Articles: 
http://www.cnblogs.com/heshan664754022/archive/2013/03/27/2984357.html

 

Published 273 original articles · won praise 77 · views 490 000 +

Guess you like

Origin blog.csdn.net/spt_dream/article/details/104517438