Configuring Tomcat with IntelliJ idea (Getting started)

Source: Internet
Author: User
Tags md5 sha1 zip tomcat tomcat server

First, download Tomcat

1, enter the official website http://tomcat.apache.org/, select Download, download the required version of Tomcat.

Here we choose to download the latest version of Tomcat 9.

Note There are zip and exe two formats, ZIP (64-bit Windows zip (PGP,MD5,SHA1)) is free to install version, EXE (32-bit/64-bit Windows Service Installer (PGP,MD5, SHA1)) is the installation version. Also observe whether your computer is a 64-bit system or a 32-bit system.

Select Download zip version here;

Unzip directly after download,

2. Locate the Startup.bat under Directory Bin and click Start Tomcat;shutdown.bat: Close Tomcat.

3. After starting Tomcat, open the browser and type http://localhost:8080 to enter the following page to indicate that the installation was successful:

Second, the Tomcat environment variable configuration

1, after the installation is complete, right click on "My Computer", click "Properties", select "Advanced System Settings";

2, select the "Advanced" tab, click "Environment variables";

You will then see the image shown below:

3, add system variable catalina_base,catalina_home in "System variable";

Variable name: catalina_base

Variable Value: D:\tools\apache-tomcat-8.5.4//tomcat installation directory

Variable name: catalina_home

Variable Value: D:\tools\apache-tomcat-8.5.4

Click OK.

4. You also need to modify the value of the classpath and path variables here. in the variable value of classpath, add:%catalina_home%\lib\servlet-api.jar; (note the addition of the value of the original variable after the English state of ";" )

in the variable value of path, add:%catalina_home%\bin;%catalina_home%\lib (note added when the value of the original variable is added in English state ";") )

Click OK and the Tomcat environment variable is configured.

5, here need to verify.

Click "Start", "Run", type "cmd" (or shortcut key win+r); Type command: Startup, the following information appears, indicating that the environment variable configuration is successful;

Third, in IntelliJ idea configuration tomcat

1, click Run-edit configurations ...

2. Click "+" on the left, select Tomcat server--local,

3. Under the Application Server project, server-Unnamed, Tomcat server, click Configuration, locate the local Tomcat server, and then click the OK button.

At this point, IntelliJ idea configures Tomcat to complete.

Iv. compiling a packaged deployment locally (need to create a good one Maven WebApp project, see another article)

1, directly under idea left the terminal terminal input MVN install, the compilation package succeeds, displays the build success word. Re-viewing the project's directory, we found that the project root directory under the target directory, the directory also played a war package.

2. Re-enter the deployment interface

3. Click + in Deployment to select the project you want to deploy.

Here you select Testdemo.war as the deployment package.

4, fill in the access path (usually the project name, the input will be synced to the Server tab of the localhost), click OK

5, in the main interface application Servers can see the deployment of the project, click on the left Green triangle to run the Tomcat server

The following is displayed when clicked:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.