5.1 Adding Tomcat to IDEA Ultimate
Step one. Create a local Tomcat configuration. Run-Edit Configurations-

Step two. Then select the local Tomcat.

Step three. Configuring Tomcat. By clicking on strong>configure add the path to the Tomcat folder

Here you can specify:
HTTP port
- the port on which Tomcat will runJRE
- you can choose the JRE on which Tomcat will runVM options
- virtual machine settings for TomcatURL
- this link will be opened by IDEA after starting the server with its help
Step four. We add our project as an artifact to Tomcat.
To do this, go to the Deployment tab and click the + button on the right.

That's all!
5.2 Creating the first web application
If you don't have any web application yet, then you can create it in IDEA in two ways. A Maven based project and just a native JavaEE project.
If you want to create a native web project from IDEA, then follow this simple instruction:
Step 1 . Create a new project ( menu File -> New Project
), then select:
- Project Type - Java Enterprise
- Application template - Web Application
- Application Server - The currently configured Tomcat Server . If it has not been added yet, then there is a button on the right
New
. - JDK - your current Java JDK

Step 2 . Further, IDEA will ask you to specify various dependencies, do not add anything.

Step 3 If Tomcat has been configured correctly, then you will see your application:

Step 4 Your project is ready, you can run it with the Run or Debug button.
5.3 Building Your First Maven Web Application
If you want to create a web application based on a Maven project, then the instructions will be even simpler.
Step 1 . Create a new project ( menu File -> New Project
), then select:
- Project Type - Maven Archetype
- JDK - set the JDK of the project
- Archetype (project template) - set maven-archetype-webapp

Step 2 . We get a project like this:

The project has been generated, but Tomcat has not yet been configured. To be able to run or debug a project, you need to set up Tomcat and add your project to it as an artifact. How exactly to do this, we have already considered earlier.
Step 3 If Tomcat is configured correctly, then your settings page should look something like this:

Step 4 Your project is ready, you can run it with the Run or Debug button.
GO TO FULL VERSION