Meaningless Drivel is fun!
The moose likes Beginning Java and the fly likes javax.servlet.http.* missing? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "javax.servlet.http.* missing?" Watch "javax.servlet.http.* missing?" New topic

javax.servlet.http.* missing?

sherrie blaylock

Joined: Nov 17, 2004
Posts: 3
i am trying to go through the head first servlets & jsp book
i downloaded tomcat for the first time and j2sdk1.4.2_06
i amtrying to do the first exercise and i keep getting the following error
i dont know where or if i have the class javax.*
please help

C:\project1\src>javac -classpath tomcat/common/lib/servlet-api.jar -d classes Ch
error: cannot read:
1 error

C:\project1\src>javac -classpath tomcat/common/lib/servlet-api.jar -d classes Ch package javax.servlet does not exist
import javax.servlet.*;
^ package javax.servlet.http does not exist
import javax.servlet.http.*;
^ cannot resolve symbol
symbol : class HttpServlet
location: class Ch1Servlet
public class Ch1Servlet extends HttpServlet {
^ cannot resolve symbol
symbol : class HttpServletRequest
location: class Ch1Servlet
public void doGet(HttpServletRequest request,
^ cannot resolve symbol
symbol : class HttpServletResponse
location: class Ch1Servlet
HttpServletResponse response)
5 errors

Amit Saini
Ranch Hand

Joined: Oct 20, 2004
Posts: 280
are you sure you have j2ee.jar in your classpath?
Junilu Lacar

Joined: Feb 26, 2001
Posts: 6529

The path you gave is relative. Is the tomcat directory under c:/project/src? If not, then you need to give the absolute path to the servlet-api.jar.

Junilu - [How to Ask Questions] [How to Answer Questions]
I agree. Here's the link:
subject: javax.servlet.http.* missing?
It's not a secret anymore!