Tomcat configuration environment variables

1. Install JDK and Tomcat
1. Install JDK: directly run the jdk-7-windows-i586.exe executable program, which can be installed by default.
Note: The path can be other drive letters, and it is not recommended that the path contain Chinese names and special symbols.
2. Install Tomcat: directly decompress the downloaded file "apache-tomcat-7.0.33-windows-x86.zip" to the C drive. It is recommended to modify the installation path to: c:\tomcat.
Note: If you download an executable file, double-click to run, and the default installation can be done.

2. Configure JDK environment variables (see how to configure environment variables in the steps)
1. New variable name: JAVA_HOME, variable value: C:\Program Files\Java\jdk1.7.0
2. Open PATH and add variable value: %JAVA_HOME%\ bin;%JAVA_HOME%\jre\bin
3, new variable name: CLASSPATH, variable value: .;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jarRemarks
:
1, . indicates the current path, %JAVA_HOME% refers to the JAVA_HOME specified earlier;
2, JAVA_HOME indicates the JDK installation path, which includes lib, bin, jre and other folders, and the operation of tomcat, eclipse, etc. needs to rely on this variable.
3, PATH enables the system to recognize java commands in any path.
4. CLASSPATH is the path of the java loaded class (class or lib), and the java command can only be recognized if the class is in the classpath.

3. Test JDK
Enter the javac, java, javadoc commands under the CMD command: the icon interface appears, indicating that the installation is successful.
How to configure environment variables in tomcat

4. Configure Tomcat environment variables
1, create a new variable name: CATALINA_BASE, variable value: C:\tomcat
2, create a new variable name: CATALINA_HOME, variable value: C:\tomcat
3, open PATH, add the variable value: %CATALINA_HOME%\lib;%CATALINA_HOME%\bin

5. Start the Tomcat
service There are two methods:
1. Method 1: Enter the command under the CMD command: startup, the following dialog box will appear, indicating that the service is started successfully.
2. Method 2: Right-click "My Computer" -> "Management" -> "Services and Applications" -> "Services" on the desktop, find the "Apache Tomcat" service, right-click the service, and select "Properties" , and change the "Startup Type" from "Manual" to "Automatic".
How to configure environment variables in tomcat

6. Test Tomcat
Open the browser, enter http://localhost:8080 in the address bar and press Enter. If you see a JSP page that comes with Tomcat, it means that your JDK and Tomcat have been built successfully.
How tomcat configures environment variables

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326521655&siteId=291194637