Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does import javax.servlet.*; cannot be resolved despite of installing Java EE | Eclipse for Java EE Developers [duplicate]

The open source project which I want to use needs to import:

import javax.servlet.*;
import javax.servlet.http.*;

As far as I know those libraries are part of the Java EE. So I installed Java EE from this location: http://www.oracle.com/technetwork/java/javaee/downloads/java-ee-sdk-7-jdk-7u21-downloads-1956231.html . After installing Java EE and rebooting I still get information about unresolved imports. What should I do to make those errors disappear? enter image description here

like image 611
Yoda Avatar asked Nov 25 '13 15:11

Yoda


People also ask

How do I import the javax servlet API in my Netbeans project?

Right-click your project, click on properties->Java Build path->Libraries tab->click Add External JARs->Browse for servlet-api. jar and select it->click OK to update the build path. Right-click the project, click properties->Java Build Path->click ADD JARs->find servlet-api.

Where is javax servlet package?

It contains, among others, the files /usr/share/java/servlet-api-2.5. jar and /usr/share/java/jsp-api-2.1. jar , which are the servlet and JSP libraries you need.


1 Answers

please cross check if your eclipse is pointing to JDK and not JRE

check in build path, it has to point to JDK change if it is pointing to JRE Like this

like image 186
dev2d Avatar answered Sep 20 '22 08:09

dev2d