• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3064
  • Last Modified:

Eclipse reports "The import javax.servlet cannot be resolved"...

Hi -

My Eclipse IDE has been setup to use JRE 1.5.0_03. The IDE reports that it is unable to locate the following classes:

javax.servlet.http.Cookie;
javax.servlet.http.HttpServletRequest;
javax.servlet.ServletException;

I checked rt.jar for the above version of JRE and don't find a javax.servlet package. Have these classes moved to another location?
0
baigmz
Asked:
baigmz
  • 3
  • 2
  • 2
  • +1
1 Solution
 
sciuriwareCommented:
You need to download and add an extra .jar file.

;JOOP!
0
 
sciuriwareCommented:
Download servlet.jar from Apache.

;JOOP!
0
 
sciuriwareCommented:
If you have TOMCAT installed on your computer, look at:

C:\Program Files\Apache Group\jakarta-tomcat-3.2.3\lib\servlet.jar

The TOMCAT version may be different.

Then add that .jar to your ECLIPSE project.

;JOOP!
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
Siva Prasanna KumarPrincipal Solutions ArchitectCommented:
You need to add servlet.jar or if you are using Tomcat 5.x add the all the jars starting with servlet to the build path.

Follow these steps

right click on the project and select properties

and then select java Build Path in that select libraries tab and click add external jars button and point to the above mentiond jars.

Your problem will be resolved.

Thank You.
0
 
Mayank SAssociate Director - Product EngineeringCommented:
Download Tomcat from: http://tomcat.apache.org/
0
 
baigmzAuthor Commented:
I am using WebLogic Server as my application server. Doesn't it support web application development for HTTP servlets?
0
 
Mayank SAssociate Director - Product EngineeringCommented:
It should - are you using a Weblogic plug-in for Eclipse? Make sure you have added the JARs into your project's build-path. They should be present in some lib directory under Weblogic's root folder.
0
 
Siva Prasanna KumarPrincipal Solutions ArchitectCommented:
ya ya it support web application development for HTTP servlets, will just add weblogic.jar or add all the jars in the bea\weblogic81\server\lib in the build path.

Thank You.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 3
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now