Download and install Tomcat in macOS sisierra Version 10.12.6 and configure Tomcat and create Web projects in InterlliJ IDEA 2017.2,

Source: Internet
Author: User
Tags temporary file storage

Download and install Tomcat in macOS sisierra Version 10.12.6 and configure Tomcat and create Web projects in InterlliJ IDEA 2017.2,

1. Download and install Tomcat

1. Official website (http://tomcat.apache.org/) download Tomcat 9.0 Core: zip package;

2. Unzip the package to the specified folder to complete the installation;

3. test whether the installation is successful.

Use terminal to switch to the bin directory of the folder

Get the execution permission $ chmod + x *. sh

Start Tomcat $./startup. sh

Enter localhost: 8080 in the browser. If it is displayed as a piece, the installation is successful.

Disable Tomcat $./shutdown. sh

4. installation directory description

Bin -- Tomcat execution Script directory
Conf -- Tomcat configuration file
Lib -- the library file (JARS) required for running Tomcat)
Logs -- the LOG file during Tomcat execution
Temp -- Tomcat temporary file storage directory
Webapps -- Tomcat's main Web publishing directory (which stores our own JSP, SERVLET, and Class)
Work -- Tomcat's working directory. Tomcat puts the Java and class files translated from JSP files here.

Ii. Configure Tomcat and create Web projects in InterlliJ IDEA 2017.2 Environment

1. Tomcat configuration

① Configure-> Preferences-> Build, Execution, Deployment-> Application Servers
② Add application server-> Tomcat Server
Note: This operation solves the problem where the Tomcat Server cannot be found during normal Web Project Creation.

 

 

2. Create a Web Project

① Create New Project --> Java Enterprise --> Web Application (3.1) --> check "Create web. xml" --> next

② Create a project name and path --> Finish

Create two folders under the web/WEB-INF: classes and lib

Classes is used to store the class files output after compilation, and lib is used to store third-party jar packages.

④ Configure the folder path

File-> Project Structure (shortcut: Ctrl + Shift + Alt + S)-> select Module: select Paths-> select "Use module compile output path"-> select the classes folder created in both the Output path and Test output path.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Then select Dependencies --> click "+" at the bottom-> select "Jars or Directories" -->-> select the created lib folder

--> Select "jar directory" --> then return an OK

 

⑤ In the upper-right corner, you can select the default configuration or modify the Tomcat Server configuration (name, path, default browser, etc.).

Add Tomcat

Edit deployments --> "+" in the upper left corner --> Tomcat Server --> Local

 

⑥ Running project

Click debug or run (first debug control + alt + D)

It is shown as follows, proving that the creation is successful

To stop running, press command + F2

 

Related Article

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.