wood burning stoves 2.0*
The moose likes Servlets and the fly likes package javax.servlet not found in import Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "package javax.servlet not found in import" Watch "package javax.servlet not found in import" New topic
Author

package javax.servlet not found in import

Tom Barns
Ranch Hand

Joined: Oct 27, 2000
Posts: 138
hi,
i need to set classpath to get that package,it was working,but changed my classpath setting and i do not know how to get it work.
any help will be appreciated.

Thanks for your help.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12761
    
    5
The javax.servlet package classes are usually in servlet.jar
Since this is a "standard extension" package you should be able to put servlet.jar in the JAVA_HOME\jre\lib\ext directory and not have to set it in CLASSPATH at all.
Bill

------------------
author of:
Tom Barns
Ranch Hand

Joined: Oct 27, 2000
Posts: 138
Thanks for the reply.
how is that?the problem is when i compile my servlet program i got that message,I do that before even starting up my tomcat server.where exactly do i have to set to be able to compile my servlet.
thanks alot.
Desai Sandeep
Ranch Hand

Joined: Apr 02, 2001
Posts: 1157
Hi Tom,
Check the following :

  • You have the current directory ".", in the classpath
  • As William has suggested, move/copy the servlet.jar file manually to the %JAVA_HOME%\jre\lib\ext folder.If you do this you donot need to set the classpath for javax.servlet.* packages, as the Java Run-time environment would find it for you.
  • Check my post at http://www.javaranch.com/ubb/Forum7/HTML/002990.html , to set the classpath on your machine, if you still require to do it(I hope not )

  • Hope this helps
    Regards,
    ------------------
    Sandeep Desai
    vgdesai@vsnl.com

    1. Sun Certified Java Programmer Scored 93 per cent
    2. Oracle JDeveloper Rel. 3.0 - Develop Database Applications with Java Scored 56 out of 59
    3. IBM Enterprise Connectivity with J2EE Scored 72 per cent
    4. Enterprise Development on the Oracle Internet Platform Scored 44 out of 56

    5. [This message has been edited by Desai Sandeep (edited April 10, 2001).]


<b>Sandeep</b> <br /> <br /><b>Sun Certified Programmer for Java 2 Platform</b><br /> <br /><b>Oracle Certified Solution Developer - JDeveloper</b><br /><b>-- Oracle JDeveloper Rel. 3.0 - Develop Database Applications with Java </b><br /><b>-- Object-Oriented Analysis and Design with UML</b><br /> <br /><b>Oracle Certified Enterprise Developer - Oracle Internet Platform</b><br /><b>-- Enterprise Connectivity with J2EE </b><br /><b>-- Enterprise Development on the Oracle Internet Platform </b>
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: package javax.servlet not found in import
 
Similar Threads
java.lang.NoSuchMethodError
Doubt in classpath statement....
urgent help pls!how to configure javamail
Package problem
I need help with trying to play a mp3 file with java!