Open In App

Setup Apache Tomcat Server in IntelliJ IDE for Java J2EE Development Projects

Improve
Improve
Like Article
Like
Save
Share
Report

In this article, we will discuss a step-by-step guide to set up Apache Tomcat server in IntelliJ IDE. IntelliJ IDEA is an intelligent, context-aware IDE for working with Java and other JVM languages like Kotlin, Scala, and Groovy on all sorts of applications and other web project development. For this IDE we need to add the server externally so that we will add the server called Apache Tomcat server. Tomcat Server is an application server from Apache Software Foundation (ASF) that execute java servlets and renders web page that includes java server page coding, and it’s free and open-source for implementation of the Jakarta Servlet, Jakarta Expression Language, and Web Socket technologies then Tomcat provides a “pure Java” HTTP web server environment in which Java code can run.

Note: Java EE works only in IntelliJ Ultimate, do not worry we have a solution for this also just you need to  use your college mail ID and  you will get a 1-year premium for free, or else ask your friends who  have the  college mail ID.

Step by Step Implementation

Let us go through all the detailed steps to configure the tomcat server in an IntelliJ platform.

Step 1: Download the latest version (10.0.26) of Apache Tomcat Server from this link according to your OS.

 

Step 2: After downloading, extract the file from the zip folder. Then the folder structure of the files looks like this.

 

Step 3: Open IntelliJ IDE (click on the new project button)then select Jakarta EE.

 

Step 4: Create the project name then select the template as a web application next you need to connect the tomcat server to your project so that in the application severe tab you need to click the new button and select the tomcat server, and then you need to browse the tomcat server where you extracted server file and select then click ok, and it looks like this.

before configure

after configure

Step 5: The configure to look like this and click on next.

Note: We change the server because we are already using the same server in Eclipse IDE.no problem, you can use any server.

 

Step 6: Next you need to select the specifications tab, on that we need to select the servlet and click on create button.

 

Note: No need to change the implementation part.

Step 7: The window will look like this.

 

After that, we need to check whether the server is working properly Or not so we need to click the tomcat 10.0.23 and select the run   button to see the output like this

 

The following server is running at port 8080 on localhost, and we can visit the webpage using the URL http://localhost:8080/

Note: In case you are not getting the output means you have some problem with the server port number just change the port number 8080 to 8081 it is a common error because we may run the same port in the React project or PHP project.

edit the port number

 

changing the port number

 


Last Updated : 17 Oct, 2022
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads