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
2,386 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,780 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 in Java by Rahul
• 3,380 points
516 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,890 points
422 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 in Java by Aditya
• 7,660 points
1,320 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 3,013 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,780 points
1,322 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,780 points
5,170 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,780 points
1,923 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP