|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Ziff Davis Enterprise Virtual Tradeshows: Hot Topics, Cutting Edge Technology, Real-time Networking among IT Professionals. Learn more
|
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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.javawhere you replace c athto/antlr/collections/AST with the path to imported package antlr/collections/AST |
|
#3
|
|||
|
|||
|
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 |
|
#4
|
|||
|
|||
|
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).] |
|
#5
|
|||
|
|||
|
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 URLathto/antlr/collections/AST RentBuyServlet.java where you replace c URLathto/antlr/collections/AST with the path to imported package antlr/collections/AST[/quote] |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Java Help > Please help!! -- java.lang.NoClassDefFoundError: antlr/collections/AST |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|