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?
baigmzAsked:
Who is Participating?
 
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
 
sciuriwareCommented:
You need to download and add an extra .jar file.

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

;JOOP!
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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
 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.