14
I’m using Eclipse Mars.1 for web development, I received this error when including a file JSP
, The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
.
I also have Tomcat 8 running on PC.
14
I’m using Eclipse Mars.1 for web development, I received this error when including a file JSP
, The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
.
I also have Tomcat 8 running on PC.
18
As with the database, the Eclipse does not recognise the service of Apache Tomcat just because it is present in the system, a plugin is required for the Eclipse.
C:\Program Files\Apache Software Foundation\Tomcat 8.0
ex:The error must have disappeared, trying to fix the problem, before all this installed on Eclipse a plugin for Tomcat and software Jboss Apache Tomcat Integration, but I don’t know how far these are needed.
9
The solution I found was a little different, and I’ll leave it here because just adding the server and changing Project Facets didn’t help me:
<dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>3.1.0</version> <scope>provided</scope> </dependency>
This is the solution if the project uses Maven and Eclipse has installed the M2E plugin (Maven 2 Eclipse). The version (3.1.0
) is correct for Tomcat 8 as per documentation. Anyone using a different version of the server needs to check the correct version of the API.
1
Good evening, everyone
the ai solution to add the dependency on Maven solves as well. Just to help, it can be solved in the first way suggested by adding Target Runtime to Project Facets. It turns out that after doing this, you also need to configure the project to use the server libraries in question. For this, go to the Build Path settings, in the "Libraries" tab press the "Add Library" button, select "Server Runtime" and then the Server you used, in my case "Tomcat 7.0" Then just apply and that’s it.
Browser other questions tagged java java-ee eclipse jsp tomcat
You are not signed in. Login or sign up in order to post.
Much simpler to just add Java EE5 Libraries to the build path
– user49332