aspose file tools*
The moose likes Java in General and the fly likes import Statement Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "import Statement" Watch "import Statement" New topic
Author

import Statement

Ram Adsumalli
Ranch Hand

Joined: Oct 16, 2006
Posts: 64
Hi

I am using Eclipse 3.2 Version. I am trying the import the javax.servelt.*. But throwing the error like unresolve statement. Do i need to any jar files. java.io.* statement is working fine.

Adsumalli.
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2367
javax.servlet is not part of the standard J2SE. It is part of J2EE. You can also find the .jar file with the package in it if you download Tomcat.
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Aside from the typo in "servlet," note that javax.servlet is in Java Enterprise Edition (EE), and not in the Standard Edition (SE). Have you installed the Enterprise Edition (or at least something like Tomcat that provides the servlet packages)?


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Ram Adsumalli
Ranch Hand

Joined: Oct 16, 2006
Posts: 64
Hi Guys,

I know that servlet is not under J2SE. I installed Tomcat 6.0 in my desktop. Do i need to add any jar files in Eclipse related to J2ee. If yes where in eclipse i need to add jar files.

Thanks
Adsumalli.
Jeroen T Wenting
Ranch Hand

Joined: Apr 21, 2006
Posts: 1847
Reference them from your project. See the project options...

And of course import javax.servelt.*; isn't going to work no matter what


42
Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1321

Originally posted by Raghu Adsumalli:


Do i need to add any jar files in Eclipse related to J2ee. If yes where in eclipse i need to add jar files.



Answer is YES you need to add servlet-api.jar or servlet.jar into your project.

go to the project properties and select the Java build path option from the left panel then going to the libraries tab to add your jar file there.


Saifuddin..
[Blog][Linkedin] How To Ask Questions On JavaRanch My OpenSource
 
Consider Paul's rocket mass heater.
 
subject: import Statement