• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

package javax.servlet not found in import

 
Tom Barns
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13074
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic