• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

import Statement

 
Ram Adsumalli
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2409
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)?
 
Ram Adsumalli
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1847
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Reference them from your project. See the project options...

And of course import javax.servelt.*; isn't going to work no matter what
 
Muhammad Saifuddin
Ranch Hand
Posts: 1324
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic