Tomcat downloads, installs, and configures environment variables, but the problem of flashback occurs when the startup file is opened. Solution

1. Install

Download tomtcat from the official website. Take version 8 as an example. If the computer is 64-bit, download the 64-bit compressed package and decompress it.

 

 After the decompression is complete, you can delete the compressed package. Sometimes it is the unpacked file. You can choose the installation path and copy it there. My installation path is D:\software\tomcat\apache-tomcat-8.5. 82-windows-x64\apache-tomcat-8.5.82.

 2. Configure environment variables

Find a way by yourself, let me tell you what I use: right-click on this computer, find properties, click advanced system settings, select environment variables,

 Find the following system variable, note that it is not the above, it is the system variable below, click New, fill in CATALINA_HOME for the variable name, and the variable value is the path where you installed tomcat. When you see bin, like me, then confirm

 Find the path under the system variable, then double-click that line, then click New, copy this and fill it in, %CATALINA_HOME%\bin

 

 The installation and environment variables are configured here. Open the cmd window and enter startup.bat. This means that the installation is successful.

Do not close the command window, enter http://localhost:8080/ in  the browser and the following page will appear, and it will be successful. You don’t need to read the following

 3. What should I do if it is not started correctly?

But when we check whether tomcat is successfully installed, double-click startup, and the command window will flash back, or the following prompt will appear: Neither the JAVA_HOME nor the JRE_HOME environment variable is defined

 Solution: Find and edit the startup batch file, which is under the bin path of tomcat, some with .bat behind, and some without

Put the following text in the first two lines, the first line is the installation path of Java, the second line is the installation path of tomcat, you have to copy your own path

SET JAVA_HOME=C:\Program Files\Java\jdk1.8.0_131

SET CATALINA_HOME=D:\software\tomcat\apache-tomcat-8.5.82-windows-x64\apache-tomcat-8.5.82

Just like this, do the same with the shutdown file

 Finally, there is a service file, add the following, note that the first line is also your own installation path

Set CATALINA_HOME=D:\software\tomcat\apache-tomcat-8.5.82-windows-x64\apache-tomcat-8.5.82
SET SERVICE_NAME=Tomcat
SET PR_DISPLAYNAME=Apache Tomcat

 Finally restart tomcat on the line. See if there is tomcat running in the service. The opening step is to right-click on this computer, select management, find the service and application to open, and start as follows.

 

 

 

 

Guess you like

Origin blog.csdn.net/weixin_52435020/article/details/127040563