天天看點

解決eclipse bug:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path使用eclipse建構Maven

The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

  • 使用eclipse建構Maven

使用eclipse建構Maven

今天,使用eclipse建構Maven的時候,第一行jsp的代碼一直報紅,找了網上的各種方法,在我這都不能生效。

https://blog.csdn.net/s941015n/article/details/80513050

像上面的,通過添加tomcat伺服器的,無效。

後來,在pom裡面添加了一個依賴

<dependency>
	<groupId>javax.servlet</groupId>
	<artifactId>javax.servlet-api</artifactId>
	<version>3.1.0</version>
	<scope>provided</scope>
</dependency>
           

如果你覺的版本太老了,可以自己去Maven

https://mvnrepository.com/ 上面的網站中,搜尋最新的javax.servlet-api

想不到有一位老哥,和我一樣的解決辦法:

https://www.cnblogs.com/pszw/p/3677530.html