-
Java Compiler
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
-
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.
-
I think you need to add servlet.jar to your classpath for when you compile. Have you done that?
-
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
-
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.