[antlr-interest] How to call self-build ANTLR correctly?

Johannes Luber jaluber at gmx.de
Tue Jul 3 14:16:33 PDT 2007


Randall R Schulz wrote:
> On Tuesday 03 July 2007 13:50, Johannes Luber wrote:
>> Terence Parr wrote:
>>> you need the bin not bin\org\antlr in your path.  Also add the
>>> runtime dir.
>> I do the following:
>>
>> D:\>java -cp "D:\Install Files\ANTLR\antlr-source\bin\org\antlr\runtime" "D:\Install Files\ANTLR\antlr-source\bin"\org.antlr.Tool
> 
> You're telling Java to run a nonsense class name. There should be no
> file path name syntax in the main entry-point class name. It's just
> org.antlr.Tool. That is, the last argument in the command line you gave
> should simply be org.antlr.Tool. Of course, you'll need to supply other
> arguments—at least a grammar source file and any options you choose.
> 
> But ANTLR itself requires ANTLR v2.7 in its class path, since the parser
> that ANTLR v3 uses to parse ANTLR source is (currently) and ANTLR v2.7
> parser. You also need the string template library. Since that source is
> distributed separately, I don't suppose it's going to be in the results
> produced by bulding ANTLR, but I don't know that for a fact.

D:\>java -cp "D:\Install Files\ANTLR\antlr-source\bin\org\antlr\runtime"
-cp "D:\Install Files\ANTLR\antlr-source\bin" -cp "D:\Install
Files\ANTLR\antlr-3.0\lib\antlr-2.7.7.jar" -cp "D:\Install
Files\ANTLR\antlr-3.0\lib\stringtemplate-3.0.jar" org.antlr.Tool

Output:

Exception in thread "main" java.lang.NoClassDefFoundError: org/antlr/Tool

Not much of an improvement. Maybe the CLASSPATH, I've set for the
distributed answer, is interfering but I don't know how to undefine an
environment variable in a DOS box anymore.

Best regards,
Johannes Luber

I'm not


More information about the antlr-interest mailing list