[antlr-interest] Help!!!

Mohad Nur mr_nur2000 at yahoo.com
Sun Apr 4 14:54:13 PDT 2004


>Hello, 
>
>I am a newbie in antlr. 
>
>I believe I have configed the CLASSPATH correctly, because
>I can use antlr.Tool expr.g to generate:

>ExprLexer.java
>ExprParser.java
>ExprParserTokenTypes.java
>ExprParserTokenTypes.txt
>
>It seems work well.

>Then I type javac *.java, nothing wrong.
>But when I want to run the Main class: java Main,
>I always got NoClassDefException :(

>I 've tried many times and the results are same.
>By the way, when I compiled the *.java files, if I compile
>them individulely, I will got errors. Just like it cannot find
>the antlr.* package.

>If you can help me with this, it would be very nice.

>Thank you!

>Tonie


Hi Tonie,

A newbie like u here i had the same problems when i started........i found out that it is beacause of the directory structure and the package statement.If you have the statement:

package antlr;

There has to be a corresponding directory 'antlr' which the classes will be placed when they are being compiled. so to compile you should give the command 'javac *.java -d antlr' and it should work.

Hope That helps,

Nur




---------------------------------
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway - Enter today
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20040404/e1064b48/attachment.html


More information about the antlr-interest mailing list