How to configure, start, configure, and start tomcat
After installing jdk, we found that clicking the tomcat startup. bat file will return in seconds.
This is because our tomcat is not configured properly.
Now let's talk about the proof.Configure tomcat.
1.
First download Jdk
Official Website: http://www.oracle.com/technetwork/java/javase/downloads/index.html
2.
Configure environment variables:
Right-click "computer", select "properties", click "Advanced System settings", select the "advanced" tab, and click "environment variables" in the lower part"
3.
Create a system variable:
Variable name: JAVA_HOME
Variable value: Your JDK installation directory
4.
Create a new system variable:
Variable name: CLASSPATH
Value:.; % JAVA_HOME % \ lib \ dt. jar; % JAVA_HOME % \ lib \ tools. jar; % atat_home % \ BIN
Note: The preceding vertex number
5.
Modify the PATH variable
Variable name: PATH
Value:; % JAVA_HOME % \ bin; % JAVA_HOME % \ jre \ bin;
Note: The semicolon, Add this value to the end of the path variable value ,.
6.
Create Tomcat environment variable
Variable name: TOMCAT_HOME
Variable value: directory where your TOMCAT is located
7.
Now you can start running the tomcat/bin/startup File.
8.
Finally, tomcat is successfully run.
Http://jingyan.baidu.com/album/03b2f78c46409b5ea237aefd.html
Enter the bin directory in the installation directory of your tomcat and run the following command in cmd (to enter the bin directory of tomcat), or double-click startup. bat starts tomcatshutdown. bat closes tomcatservice install (service. bat with the install parameter) to install the service.
How to configure and start Tomcat in zip version?
Install JDK first. You do not need to set environment variables in the current version as long as the version is installed, for a non-installed version, right-click my computer and choose Properties> advanced> environment variables> system variables to add the following environment variables (assuming that your j2sdk is installed in c: \ j2sdk1.5.0):
JAVA_HOME = c: \ j2sdk1.5.0
Classpath =.; % JAVA_HOME % \ lib \ dt. jar; % JAVA_HOME % \ lib \ tools. jar;
(.; Must not be less, because it represents the current path)
Path = % JAVA_HOME % \ bin
Decompress TOMCAT and add the following environment variables to the system variables (assuming that your tomcat is installed in c: \ tomcat ):
CATALINA_HOME = c: \ tomcat
CATALINA_BASE = c: \ tomcat
Modify the classpath in the environment variable, and append servlet. jar under the common \ lib directory under the tomat installation directory (you can append it according to the actual situation) to the classpath. The modified classpath is as follows:
Classpath =.; % JAVA_HOME % \ lib \ dt. jar; % JAVA_HOME % \ lib \ tools. jar; % CATALINA_HOME % \ common \ lib \ servlet. jar;
Start tomcat and access localhost: 8080 in IE. If you see the welcome page of tomcat, the installation is successful.
How to configure and start Tomcat in zip version?
Install JDK first. You do not need to set environment variables in the current version as long as the version is installed, for a non-installed version, right-click my computer and choose Properties> advanced> environment variables> system variables to add the following environment variables (assuming that your j2sdk is installed in c: \ j2sdk1.5.0):
JAVA_HOME = c: \ j2sdk1.5.0
Classpath =.; % JAVA_HOME % \ lib \ dt. jar; % JAVA_HOME % \ lib \ tools. jar;
(.; Must not be less, because it represents the current path)
Path = % JAVA_HOME % \ bin
Decompress TOMCAT and add the following environment variables to the system variables (assuming that your tomcat is installed in c: \ tomcat ):
CATALINA_HOME = c: \ tomcat
CATALINA_BASE = c: \ tomcat
Modify the classpath in the environment variable, and append servlet. jar under the common \ lib directory under the tomat installation directory (you can append it according to the actual situation) to the classpath. The modified classpath is as follows:
Classpath =.; % JAVA_HOME % \ lib \ dt. jar; % JAVA_HOME % \ lib \ tools. jar; % CATALINA_HOME % \ common \ lib \ servlet. jar;
Start tomcat and access localhost: 8080 in IE. If you see the welcome page of tomcat, the installation is successful.