Tomcat startup failure solution (idea)

Check jdk version

Check the project structure in the upper right corner of idea, click Project, modify Project SDK and Project Language level, I use java 1.8

Please add image description

Check module

1. Check if the Web exists

If it is a jsp project, to be packaged into war, you need to check whether the following content exists

Please add image description

If there is no Web under the module, you need to add it

Insert image description here

Or you can add it in Facets

Insert image description here

2. Check whether the Artifacts are Exploded

Insert image description here

If not, you need to click Add

Insert image description here

Check Tomcat configuration

Insert image description here

If Tomcat is not configured, click on the upper left corner to add

Tomcat Home Select the installation path of Tomcat and it will be automatically recognized

Insert image description here

View configuration information

Ports can be configured by yourself

Insert image description here

Click Deployment to see if there is a war exploded

Insert image description here

If it does not exist, click on the right to add it.
Insert image description here

After completion, you can modify the virtual path yourself

Insert image description here

Check dependencies

If Tomcat already exists in the project, but there are still no Servlet-related dependencies, you can check whether the dependencies exist in External Libraries.

Insert image description here

If it is not in JDK and Tomcat, consider re-creating the project and configuring Tomcat

Guess you like

Origin blog.csdn.net/weixin_62726289/article/details/133158711