Is it necessary to configure environment variables for tomcat?
I have published an article about how to install and configure Tomcat, but I have always reported errors during development projects recently. Later, I was asked by the company's experts: Who told you that Tomcat needs to be configured with environment variables?
As a newbie, I am not good at all! So Baidu finally found out the truth about Tomcat configuration.
1. After extracting Tomcat, run startup. bat in the bin directory to start Tomcat!
2. If startup. bat is not run in the bin directory, the startup will fail and startup. bat will crash!
This solves the problem of installing multiple Tomcat on a computer derived from it:If you want to start multiple tomcat servers at the same time, either the environment variables are not configured or all are configured.
Let's take a look at the source code of the startup. bat file ~
Ah, Haha, I don't know much about it, but I can probably see that it is
Check whether the value of CATALINA_HOME is null. If the value is null, set the current directory to the value of CATALINA_HOME;
Then, determine whether catalina. bat exists. If it does not exist, set the current directory to the value of CATALINA_HOME;
Determine whether the catalina. bat in the environment variable exists. If yes, call the "catalina. bat start" command in the bin directory ~
Then let's look at the source code of the catalina. bat file ~
Determine whether CATALINA_BASE is null and set its value to the value of CATALINA_HOME.
As ...... Path variable ...... I can't find it in the source code or Baidu can't find the relevant information. I didn't talk about it in the documents on the official website ...... Now I really don't know how to use it.
But in the code, I see the CLASSPATH variable
Here, the green font, starting with rem, is a comment. If you don't understand it, copy it to google Translate ......
This means to determine and set the classpath variable, and then find the file based on the classpath variable.
To sum up, tomcat's environment variables are automatically matched during running. Why are we still blind ** to configure them?
Reference: http://www.cnblogs.com/heshan664754022/archive/2013/03/27/2984357.html