File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help me solve 'package javax.servlet does not exist' error

 
srinivas pola
Greenhorn
Posts: 24
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have completed SCJP and now started preparing for SCWCD.
I have installed tomcat6 and jdk1.5

I am not using any IDE and compiling the classes through command prompt itself.

The environment variables i have set are as follows:
CLASS_PATH - C:\jdk1.5\lib;C:\tomcat6\lib\servlet-api.jar;C:\tomcat6\lib\jsp-api.jar;C:\tomcat6\webapps
JAVA_HOME - C:\jdk1.5
Path - C:\jdk1.5\bin;C:\jdk1.5;C:\jdk1.5\jre\bin\server

When i'm trying to compile the servlet i'm getting this error

C:\tomcat6\webapps\HeadFirst\WEB-INF\classes\web>javac BeerSelectAction.java
BeerSelectAction.java:3: package javax.servlet does not exist
import javax.servlet.*;
^
BeerSelectAction.java:4: package javax.servlet.http does not exist
import javax.servlet.http.*;
^
BeerSelectAction.java:7: cannot find symbol
symbol: class HttpServlet
public class BeerSelectAction extends HttpServlet {
^
BeerSelectAction.java:9: cannot find symbol
symbol : class HttpServletRequest
location: class com.example.web.BeerSelectAction
public void doPost(HttpServletRequest request,
^
BeerSelectAction.java:10: cannot find symbol
symbol : class HttpServletResponse


Please help me solve this error.

Thanks in advance.
 
Ranil Liyana Arachchige
Ranch Hand
Posts: 71
Hibernate Spring Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

It looks like your classpath has not well been set, please refer to this url and see if you can set it properly

http://java.sun.com/j2se/1.3/docs/tooldocs/win32/classpath.html

hope that helps you,

Regards,
Ranil
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
CLASS_PATH -> CLASSPATH
 
srinivas pola
Greenhorn
Posts: 24
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the replies...

I was thinking in a complicated manner and forgot about the simple things

Anyways thanks a lot
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic