Java environment configuration in Windows, tomcat installation, javatomcat
Problem description: Java and tomcat are the basis for Java web-related projects under Windows. Here we will record the configuration of the Java environment and the installation and configuration of tomcat.
Tools used: Windows, jdk installation package, and tomcat 9.0 installation package.
Procedure:
1. Configure Java environment variables.
Download and install jdk-> right-click my computer-> properties-> advanced system settings-> environment variables ", create the following three variables (edit if they already exist ):
JAVA_HOME: C: \ Program Files \ Java \ jdk1.8.0 _ 111 // jdk installation path, to the bin layer.
CLASSPATH: % JAVA_HOME % \ lib \ tools. jar;
Path: % JAVA_HOME % \ bin; % JAVA_HOME % \ jre \ bin;
Run "Java", "javac", and "Java-version" in cmd. If the installation is successful, no error message is displayed.
2. Install tomcat9.0.
Download tomcat and decompress it to the location where you want to install it. For the configuration of Java environment variables, create the following four variables (edit if they already exist ):
TOMCAT_HOME: C: \ Program Files \ tomcat // tomcat installation path, to the bin layer.
CATALINA_HOME: C: \ Program Files \ tomcat // same as above
Path: % CATALINA_HOME % \ bin
CLASSPATH: % CATALINA_HOME % \ lib \ servlet-api.jar
After configuration, run cd to C: \ Program Files \ tomcat \ bin in cmd and run the "service install Tomcat9" command.
Enter "http: // localhost" in the address bar of the browser. The following figure is displayed even if the installation is successful:
3. The default tomcat port is 8080. to modify the port, find "server." in the "conf" folder. xml, change 8088 of "Connector port = '000000'" in the file to your desired port number, save it, and restart tomcat.