简体   繁体   中英

javax.servlet.http.HttpServlet was not found even if maven dependency exists

I have an issue with my Eclipse Neon configuration on my maven project. The issue that appears many times is the following The superclass "java.servlet.http.HttpServlet" was not found on the java build path . I know there were few posts about that and know also that there is two solutions. The first one is to add a Tomcat server on runtime and the second one is to add servlet dependency in the pom.xml. As it's an SVN project, the depedency was already in it and anyone in my team has a Tomcat configured on runtime but the project is building well on their eclipse. Any idea ?

The problem was that I had some errors when I built the project for the first time. The solution was to empty the m2 folder which is the local maven repository, then clean and build and it works.

You can also resolve this issue by Updating the Maven dependencies in your project. You can do this by Right click on the project -> Maven -> Update Project

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM