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 in Java by kartik
• 15,440 points
71 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 by Niroj
• 32,200 points

Related Questions In Java

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 in Java by Gitika
• 31,310 points
55 views
0 votes
1 answer

Following error is occurring "Can't start Eclipse - Java was started but returned exit code=13"

There are combinations of Operating System, JDK ...READ MORE

answered Apr 19, 2018 in Java by Rishabh
• 3,580 points
1,402 views
0 votes
1 answer

How to resolve the error: could not find or load main class?

If you are getting error: could not ...READ MORE

answered May 28, 2018 in Java by Parth
• 4,630 points
2,536 views
+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 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,047 views
0 votes
0 answers
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 in Java by Niroj
• 32,200 points
104 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 in Java by Niroj
• 32,200 points
96 views
0 votes
1 answer