PDA

Click to See Complete Forum and Search --> : Java Compiler


mrstuff68
May 30th, 2003, 08:30 PM
I am trying to learn Jakarta Tomcat to do some JSP programming. I have downloaded the JKD 1.4 and Tomcat 4.2 to do this JSP, i have installed all the software and my Tomcat server is working, my JSP example scripts work.

But when i go to compiler one of my .java documents to get the .class file it doesnt want to work. Here is what i am doing. And the errors that I got. What can i do to fix this.


D:\j2sdk1.4.1_03\bin>javac HelloServlet.java
HelloServlet.java:2: package javax.servlet does not exist
import javax.servlet.*;
^
HelloServlet.java:3: package javax.servlet.http does not exist
import javax.servlet.http.*;
^
HelloServlet.java:13: cannot resolve symbol
symbol : class HttpServlet
location: class HelloServlet
public class HelloServlet extends HttpServlet {
^
HelloServlet.java:14: cannot resolve symbol
symbol : class HttpServletRequest
location: class HelloServlet
public void doGet(HttpServletRequest request,
^
HelloServlet.java:15: cannot resolve symbol
symbol : class HttpServletResponse
location: class HelloServlet
HttpServletResponse response)
^
HelloServlet.java:16: cannot resolve symbol
symbol : class ServletException
location: class HelloServlet
throws ServletException, IOException {
^
6 errors

D:\j2sdk1.4.1_03\bin>



Thanks to all that reply

mrstuff68
May 30th, 2003, 09:40 PM
I have also double checked to make sure that my classpath is pointing to the servlet.jar file, but for some reason it doesnt want to work.

I have even gone so far as to unzip the jar file onto my harddrive. Now there is a physical copy of the .jar file in my D:\javax folder.

Please help me fix this.

crptcblade
May 31st, 2003, 11:07 AM
I think you need to add servlet.jar to your classpath for when you compile. Have you done that?

mrstuff68
Jun 1st, 2003, 11:03 PM
Yes, my servlet.jar is in my classpath, i made sure. Also I check in my dos prompt by typeing the set command and in the classpath it is pointing to the the jar file.

I even unzipped the jar file onto my harddrive and it compiler once but that was it.

Thanks for the help

mrstuff68
Jun 2nd, 2003, 11:32 AM
Well for some reason it works now, so dont worry about this. I just deleted the classpath and then retyped it and it works fine now.