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

0 votes

I have a project created by Maven integration in Eclipse. All work fine, but in the work space in all JSP files have this:

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

How to fix this error?

Jun 3, 2020 in Java by kartik
• 37,510 points
3,805 views

1 answer to this question.

0 votes

Hello @kartik,

Include servlet-api-3.1.jar in your dependencies.

  • Maven

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

    configurations {
        provided
    }
    sourceSets {
        main { compileClasspath += configurations.provided }
    }
    dependencies {
        provided 'javax.servlet:javax.servlet-api:3.1.0'
    }

Hope this help!!

answered Jun 3, 2020 by Niroj
• 82,880 points

Related Questions In Java

0 votes
0 answers

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

I have a project created by Maven ...READ MORE

Apr 21, 2022 in Java by Rahul
• 3,380 points
1,339 views
0 votes
1 answer

java path not found in window 7

Hey, You can follow these few steps: From the ...READ MORE

answered Apr 3, 2020 in Java by Gitika
• 65,910 points
886 views
0 votes
1 answer

Can not find the tag library descriptor for “http://java.sun.com/jsp/jstl/core”

If you have a jstl.jar file while ...READ MORE

answered Feb 17, 2022 in Java by Aditya
• 7,680 points

edited Jun 22, 2023 by Khan Sarfaraz 22,722 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,023 views
0 votes
1 answer
0 votes
1 answer

How to install Maven artifact with sources from command line?

Hello @kartik, To download sources for your dependencies: mvn ...READ MORE

answered Jun 3, 2020 in Java by Niroj
• 82,880 points
2,437 views
0 votes
1 answer

Error: Could not create the Java Virtual Machine Mac OSX Mavericks

Hello @kartik, Normally this error occurs when you ...READ MORE

answered May 21, 2020 in Java by Niroj
• 82,880 points
6,573 views
0 votes
1 answer

Error:jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class

Hello @kartik, The servlet API .jar file must ...READ MORE

answered Jun 3, 2020 in Java by Niroj
• 82,880 points
3,492 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP