Deploying Tomcat8.5.41 environment under Windows

Table of Contents

Pre-installation requirements:

1. Download TomCat8.5.41 version

2. Deploy JAVA environment

Tomcat environment deployment process:

Configure environment variables

check

Complete

Possible problems and solutions:

The startup.bat window flashes by

If a JRE_HOME error occurs

If a JAVA_HOME error occurs

If a CATALINA_HOME error occurs


Pre-installation requirements:

1. Download TomCat8.5.41 version

Download method one: official website download

tomcat official website

Download method two:

tomcat8.5 blue cloud download

2. Deploy JAVA environment

1. Download JAVA8

https://www.oracle.com/java/technologies/downloads/#java8icon-default.png?t=N7T8https://www.oracle.com/ java/technologies/downloads/#java82.Deploy JAVA environment

1. Right click [This PC] → [Properties]

2. Select [Advanced system settings]

3. Select [Environment Variables]

4. In the system variables interface, click [New] below

5. Create a new variable named JAVA_HOME and the variable value is the path to JAVA.

6. Create a new variable named JRE_HOME and the variable value is the jre folder in the JAVA path (if not, you need to install the JRE file first)

7. Next configure the Path in the system environment variable, click New and enter %JAVA_HOME%\bin

8. Then click New in Path and enter %JAVA_HOME%\jre

In this way, our JAVA environment is configured. Next, let’s verify it.

Verification method: WIN + R to open the run interface, write cmd in the edit box and click OK

Enter java -version in the terminal. If the java version number is returned normally, it means that the java environment variable configuration is completed.

Tomcat environment deployment process:

1. Configure environment variables

In order to prevent the configuration from being too complicated, we can use scripts for rapid deployment (not recommended for beginners, who should configure it once to familiarize themselves with the configuration environment process)

1. Copy the text content below and put it into the text document. Change the suffix to bat and the overall naming format to script name.bat

setx /M PATH "%PATH%;%?TALINA_HOME%%\bin"

setx /M CLASSPATH "%CLASSPATH%;%?TALINA_HOME%%\lib"

pause
setx /M CATALINA_BASE "D:\tomcat\apache-tomcat-8.5.41"


setx /M CATALINA_HOME "D:\tomcat\apache-tomcat-8.5.41"


pause

2. Right-click and run the two scripts as administrator.

3. Success occurs when the following prompt appears

2. Verification

1.WIN + R to open the run panel, enter startup and click OK

2. After the following content appears, open the browser and enter the URL localhost:8080

Success occurs when the following content appears

3.Perfect

Although the Tomcat environment has been deployed, the information on the terminal panel is still garbled. We will now solve the problem of garbled characters.

1. Open the conf folder in tomcat

2. Find the logging.properties file and choose to open it with a text editor

3. Find the line java.util.logging.ConsoleHandler.encoding = UTF-8 (the line number varies depending on the version. It is not recommended to look at the line number to find it) and add # in front to comment out and save \

Restart tomcat and you will see that the garbled characters have returned to normal.

Possible problems and solutions:

1.startup.bat window flashed by

This is a very common problem. We need to look at the specific error report.

1. In the bin directory of tomcat, we enter cmd and press Enter to run

2. Enter startup.bat in the window to view the error feedback

2. If a JRE_HOME error occurs

It means that the environment variable of jre is not configured or jre is not installed in the java directory.

For solutions, refer to configuring the JAVA environment in the above Pre-installation requirements

Reference link for more detailed solutions:

Tomcat JRE_HOME environment configuration problemicon-default.png?t=N7T8https://blog.csdn.net/weixin_45910254/article/details/129694499

3. If a JAVA_HOME error occurs

It means that JAVA environment variables are not configured or JAVA is not installed in the java directory.

For solutions, refer to configuring the JAVA environment in the above Pre-installation requirements

Reference link for more detailed solutions:

Tomact JAVA_HOME environment configuration problemicon-default.png?t=N7T8https://blog.csdn.net/Wanger_tt/article/details/51362142

4. If a CATALINA_HOME error occurs

Description catalina environment variable error

It may be caused by beginners using scripts. It is recommended to deploy manually and familiarize yourself with the detailed configuration process.

Reference link for more detailed solutions:

Manually configure Tomacticon-default.png?t=N7T8https://blog.csdn.net/fc12138/article/details/132746090 If you still have problems with manual configuration, you can check it out This article

Tomact catalina environment variable configuration problemicon-default.png?t=N7T8https://blog.csdn.net/weixin_44777191/article/details/132772814