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

Vue3.0 project construction and usage process

Table of contents 1. Project construction 2: Dire...

Docker Compose practice and summary

Docker Compose can realize the orchestration of D...

JS implements user registration interface function

This article example shares the specific code of ...

Detailed tutorial on installing Anaconda3 on Ubuntu 18.04

Anaconda refers to an open source Python distribu...

Linux kernel device driver character device driver notes

/******************** * Character device driver**...

Use mysql to record the http GET request data returned from the url

Business scenario requirements and implementation...

How to specify parameter variables externally in docker

This article mainly introduces how to specify par...

Implementation methods of common CSS3 animations

1. What is CSS Animations is a proposed module fo...

Detailed explanation of how to use the canvas operation plugin fabric.js

Fabric.js is a very useful canvas operation plug-...

Solve the problem of inconsistent front and back end ports of Vue

Vue front and back end ports are inconsistent In ...

Which scenarios in JavaScript cannot use arrow functions

Table of contents 1. Define object methods 2. Def...

Detailed explanation of redundant and duplicate indexes in MySQL

MySQL allows you to create multiple indexes on th...

Implementing image fragmentation loading function based on HTML code

Today we will implement a fragmented image loadin...

Summary of common sql statements in Mysql

1. mysql export file: SELECT `pe2e_user_to_compan...

Some understanding of absolute and relative positioning of page elements

From today on, I will regularly organize some smal...