[Java] How to solve “The import javax.servlet cannot be resolved” error.

How to solve “The import javax.servlet cannot be resolved” error
You may encounter “The import javax.servlet cannot be resolved” error when you create dynamic java project as below. Let me explain how to solve this error in this article.

The cause of this error is that build path setting for Apache Tomcat is not set or wrong.
Right click your project, and select Build Path > Configure Build Path…

Select Libraries tab and Click Add External JARs…


Open servlet-api.jar in the folder of apache-tomcat.
Then, click Apply and Close.

OK. “The import javax.servlet cannot be resolved” error is disappeared.

That’s all for this topic. If you think this article is beneficial for you, I would be glad if you click below icon for my motivation.
ブログランキング・にほんブログ村へ

コメント