Results 1 to 5 of 5

Thread: Java Compiler

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Posts
    492

    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

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Posts
    492
    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.

  3. #3
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    I think you need to add servlet.jar to your classpath for when you compile. Have you done that?
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Posts
    492
    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

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Posts
    492
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width