#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    4
    Rep Power
    0
    Hi there,

    When I tried to compile a servlet, I got
    the following error:

    $ javac RentBuyServlet.java
    java.lang.NoClassDefFoundError: antlr/collections/AST
    at at.dms.kjc.Main.beautifyParseError(Main.java:692)
    at at.dms.kjc.Main.parseFile(Main.java:488)
    at at.dms.kjc.Main.run(Main.java:119)
    at at.dms.kjc.Main.compile(Main.java:449)
    at at.dms.kjc.Main.main(Main.java:432)
    $

    I cannot figure out what causes this. Does
    KJC here stands the Korean-Japanese-Chinese
    language support package? I see nothing in
    my code is related tothe international
    language support though. Could some of you
    here help me out? This is my first time to
    post a msg in this forum. Your help is highly
    appreciated. If you need to see the code, I
    can show it. Please somebody help me!


    ------------------
    Regards,
    Tony

    Comments on this post

    • JimmyGosling agrees
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    14
    Rep Power
    0
    The message you are getting simply means that the javac compiler program cannot find a class that it needs. This invariably indicates that your classpath environment variable is not set correctly.
    Also, maybe your path variable might not be set to include the current file folder or directory which is desgnated as a "."
    You might just try
    javac -classpath %CLASSPATH%;.;c athto/antlr/collections/AST RentBuyServlet.java

    where you replace c athto/antlr/collections/AST with the path to imported package antlr/collections/AST
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    4
    Rep Power
    0
    Thank you, jcbell.

    After setting classpath, I got the
    following error msg:

    $ javac LeaseBuyServlet.java
    LeaseBuyServlet.java:257: Can''t find method "setContentType(java.lang.String)"
    $

    If I commented this--
    res.setContentType("text/html");
    --out, I got the following error msg:

    $ javac LeaseBuyServlet.java
    LeaseBuyServlet.java:260: Can''t find method "getWriter()"
    $

    --this is from line--
    PrintWriter out = res.getWriter();
    --

    But seen from the source code for my Java
    Servlet package, these methods all belong
    to HttpResponseServlet.

    What could be the problem? Please help.
    Thanks in advance.


    ------------------
    Regards,
    Tony
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    14
    Rep Power
    0
    From what you describe, it is clear that you need to add the jar file (jsdk.jar) for your jsdk (java servlet development kit) into your classpath statement or environment varaible

    just add it after a semicolon in your current classpath statement
    example:
    set CLASSPATH=".";%JAVA_HOME%;c:jsdklibjsdk.jar

    you can also invoke the jsdk.jar with the javac statement as in
    javac -classpath %CLASSPATH%;.;c:jsdklibjsdk.jar;pathto/antlr/collections/ASTRentBuyServlet.java RentBuyServlet.java


    ------------------


    [This message has been edited by jcbell (edited July 17, 2000).]
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    CA USA
    Posts
    2
    Rep Power
    0
    Everytime I get this message, I have a syntax error in my code. Once I fix the syntax error this error message goes away. If you can't find an error in your code, include it in another post and maybe someone else can find it.
    Hope this helps, C

    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by jcbell:
    The message you are getting simply means that the javac compiler program cannot find a class that it needs. This invariably indicates that your classpath environment variable is not set correctly.
    Also, maybe your path variable might not be set to include the current file folder or directory which is desgnated as a "."
    You might just try
    javac -classpath %CLASSPATH%;.;c athto/antlr/collections/AST RentBuyServlet.java

    where you replace c athto/antlr/collections/AST with the path to imported package antlr/collections/AST
    [/quote]


IMN logo majestic logo threadwatch logo seochat tools logo