If you’re not creating a new project from scratch and instead have an existing project that runs on Tomcat, you can configure IntelliJ IDEA Ultimate to connect to your existing Tomcat installation. Let's work with this application from GitHub:
- Clone the Project in IntelliJ IDEA and then go to Run > Edit Configurations.
- Select the + button and then Tomcat Server > Local (because we are running our Apache Tomcat server on our machine) from the drop-down:
- Give the configuration a name such as
tomcatand then click Configure next to the Application Server drop-down.
- Paste in the same path we used earlier to point to the location of Apache Tomcat on your machine and press OK.
- Leave the remaining values as the default and click the Deployment tab at the top.
- Click the + to add a new deployment artifact and select
MyWebApp:war explodedbecause that will allow you to update the application code without redeploying or restarting the server.
- Click OK to finish configuring the Run configuration.
You can run the application with ^R (macOS), or Shift+F10 (Windows/Linux) and IntelliJ IDEA will open our browser at the application’s root context which in this case displays an actual page because this app has an