Results 1 to 7 of 7
  1. #1
    aks_1 is offline Member
    Join Date
    Apr 2010
    Posts
    16
    Rep Power
    0

    Default java servlet not compiling

    i have set classpath=".;C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib\servlet.jar".
    and compiled it as-
    c:\>javac HowdyServlet.java
    but the program is not compiling.
    any help!!

  2. #2
    RamyaSivakanth's Avatar
    RamyaSivakanth is offline Senior Member
    Join Date
    Apr 2009
    Location
    Chennai
    Posts
    812
    Rep Power
    6

    Default

    what error it is throwing?
    Ramya:cool:

  3. #3
    aks_1 is offline Member
    Join Date
    Apr 2010
    Posts
    16
    Rep Power
    0

    Default

    the problem is with the import statement.
    import javax.servlet.*;
    Last edited by aks_1; 05-03-2010 at 12:34 PM.

  4. #4
    dswastik is offline Senior Member
    Join Date
    Dec 2008
    Location
    Kolkata
    Posts
    282
    Rep Power
    6

    Default

    The file name is probably servlet-api.jar.
    Swastik

  5. #5
    aks_1 is offline Member
    Join Date
    Apr 2010
    Posts
    16
    Rep Power
    0

    Default

    the error:--
    C:\jwork>javac Howdyservlet.java
    Howdyservlet.java:3: package java.servlet.http does not exis
    import java.servlet.http.*;
    ^
    Howdyservlet.java:5: cannot find symbol
    symbol: class HttpServlet
    public class HowdyServlet extends HttpServlet{
    ^
    Howdyservlet.java:6: cannot find symbol
    symbol : class HttpServletRequest
    location: class HowdyServlet
    public void doGet(HttpServletRequest request,
    ^
    Howdyservlet.java:7: cannot find symbol
    symbol : class HttpServletResponse
    location: class HowdyServlet
    HttpServletResponse response)
    ^

  6. #6
    dswastik is offline Senior Member
    Join Date
    Dec 2008
    Location
    Kolkata
    Posts
    282
    Rep Power
    6

    Default

    its javax.servlet not java.servlet.
    Swastik

  7. #7
    aks_1 is offline Member
    Join Date
    Apr 2010
    Posts
    16
    Rep Power
    0

Similar Threads

  1. Java compiling error
    By fadijava in forum New To Java
    Replies: 21
    Last Post: 10-15-2009, 08:55 AM
  2. compiling .java into .class
    By khp in forum Advanced Java
    Replies: 4
    Last Post: 06-29-2009, 02:52 PM
  3. problem compiling servlet
    By vivek_9912 in forum Java Servlet
    Replies: 1
    Last Post: 02-13-2009, 11:37 AM
  4. getting problem in compiling java program?
    By sathish04021984 in forum New To Java
    Replies: 3
    Last Post: 07-30-2007, 09:26 AM

Posting Permissions

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