Detailed steps for configuring Tomcat server in IDEA 2020

Detailed steps for configuring Tomcat server in IDEA 2020

The steps for configuring Tomcat in IDEA 2020 are as follows:

The first step is to download Tomcat

Official website link: http://tomcat.apache.org/
Select download, find the version you want, and download the corresponding version of Tomcat.

As in my previous article, I still recommend downloading the free installation compressed package.

There are two formats: zip and exe. Zip (64-bit Windows zip (pgp, md5, sha1)) is the installation-free version, and exe (32-bit/64-bit Windows Service installer (pgp, md5, sha1)) is the installation version. At the same time, check whether your computer is a 64-bit system or a 32-bit system.

Choose to download the zip version here;

insert image description here

Step 2: Experience Tomcat

After downloading the compressed package and decompressing it to the specified path, there are several bat files in the bin directory.
startup.bat: Click to start Tomcat;
shutdown.bat: shuts down Tomcat.

insert image description here

Here we click startup.bat to start Tomcat
After starting Tomcat, a terminal window will appear. Do not close it. Open the browser and type http://localhost:8080. If you enter the following page, the installation is successful:

insert image description here

Step 3: Tomcat environment variable configuration

Right click This PC -> Properties -> Advanced system settings -> Environment variables

insert image description here

Add system variables CATALINA_BASE and CATALINA_HOME in "System Variables";

Variable name: CATALINA_BASE

Variable value: E:\JavaTools\apache-tomcat-9.0.37-windows-x64\apache-tomcat-9.0.37 //Tomcat installation directory

insert image description here

Add system variables in "System variables", CATALINA_HOME;

Variable name: CATALINA_HOME

Variable value: E:\JavaTools\apache-tomcat-9.0.37-windows-x64\apache-tomcat-9.0.37 //Tomcat installation directory

insert image description here

Modify the variable values ​​of ClassPath and Path.

Variable name: CLASSPATH

Variable value: %CATALINA_HOME%\lib\servlet-api.jar; (Note that you should add “;” after the original variable value)

insert image description here

Modify the variable value of Path. After clicking path, click New on the right and add the following two variables.

Variable name: Path
Variable value: %CATALINA_HOME%\bin (note that you need to add “;” after the original variable value when adding it)

Variable name: Path
Variable value: %CATALINA_HOME%\lib (note that you need to add “;” after the original variable value)

insert image description here

This needs to be verified.

Click "Start"->"Run", type "cmd" (or the shortcut key win+R); type the command: startup, and the following message will appear, indicating that the environment variable configuration is successful;

insert image description here

Step 4: Configure Tomcat in IDEA 2020

Click Run-Edit Configurations…

insert image description here

Click the "+" on the left and select Tomcat Server-Local (there is a mistake here, it should be Tomcat, I selected TomEE instead),

insert image description here

Under Tomcat Server -> Unnamed -> Server -> Application server project, click Configuration, find the local Tomcat server, and then click the OK button. (There is a mistake here. I should have chosen Tomcat but I chose TomEE)

insert image description here

At this point, IntelliJ IDEA has completed configuring Tomcat.

Step 5: Compile, package and deploy locally

Note: To complete this step, you need to create a Maven webAPP project in advance, see another article

Directly enter mvn install in the Terminal terminal at the bottom left of idea.
The compilation and packaging are successful, and BUILD SUCCESS is displayed.
Checking the project directory again, we found that there is a target directory under the project root directory, and a war package is also generated in this directory.

insert image description here
insert image description here

Enter the deployment interface again

insert image description here

In Deployment, click + and select the project to deploy.

Select TestDemo.war as the deployment package here. (There is a mistake here. I should have chosen Tomcat but I chose TomEE)

Fill in the access path (usually the project name, which will be synchronized to the localhost of the server tab after entering), and click OK

insert image description here

In the main interface, you can see the deployed project in Application Servers

Click the green triangle on the left to run the Tomcat server (there is a mistake here. I should choose Tomcat but I chose TomEE)

insert image description here

Click and the following will be displayed:

insert image description here

This is the end of this article about the detailed steps of configuring Tomcat server in IDEA 2020. For more relevant content about configuring Tomcat in IDEA 2020, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Detailed tutorial on installing Tomcat8.5 in Centos8.2 cloud server environment
  • Alibaba Cloud Server Tomcat cannot be accessed
  • Solution to slow response of Tomcat server
  • Detailed steps for installing JDK and Tomcat on Linux cloud server (recommended)
  • Tomcat Server Getting Started Super Detailed Tutorial

<<:  Detailed explanation of the use of MySQL DML statements

>>:  Vue component communication method case summary

Recommend

Tutorial on resetting the root password of Mac MySQL

Disclaimer: This password reset method can direct...

Introduction to the properties of B-Tree

B-tree is a common data structure. Along with him...

Web Design Tutorial (1): Steps and Overall Layout

<br /> Note: All texts, except those indicat...

Solutions to MySQL batch insert and unique index problems

MySQL batch insert problem When developing a proj...

How to implement digital paging effect code and steps in CSS

A considerable number of websites use digital pagi...

Why does MySQL paging become slower and slower when using limit?

Table of contents 1. Test experiment 2. Performan...

Example of downloading files with vue+django

Table of contents 1. Overview 2. Django Project 3...

Two methods to stretch the background image of a web page

There are two solutions: One is CSS, using backgro...

mysql splits a row of data into multiple rows based on commas

Table of contents Separation effect Command line ...

Unity connects to MySQL and reads table data implementation code

The table is as follows: Code when Unity reads an...

Detailed example of changing Linux account password

Change personal account password If ordinary user...

Summary of commonly used commands for docker competition submission

Log in to your account export DOCKER_REGISTRY=reg...