[antlr-interest] Building and (not) running antlr-3.0b7

Matt Benson gudnabrsam at yahoo.com
Thu May 17 13:39:14 PDT 2007


--- "Luke A. Guest" <laguest at archangeli.demon.co.uk>
wrote:

> On Thu, 2007-05-17 at 20:39 +0100, Luke A. Guest
> wrote:
> 
> > $ java -jar lib/antlr-3.0ea9.jar org.antlr.Tool
> > Failed to load Main-Class manifest attribute from
> > lib/antlr-3.0ea9.jar
> > 
> > Don't know what this is all about. Can anyone shed
> any light?
> 

Looks like you're mixing stuff up.  The ANTLR jar
apparently doesn't provide the Main-Class attribute
(it probably could/should, so I'll put that on my TODO
list for the Ant build).  "Main-Class" is required
with the -jar flag.  However, you're also providing
the name of the main class to run--org.antlr.Tool--so
you really need to be using the -cp attribute rather
than the jar attribute.  But you'll also need more on
the classpath than that... see below:

> Ok, the build.xml needs the following line added
> after the fileset
> LICENSE.txt:
> 
> <fileset dir="${build.classes}"
> excludes="org/antlr/test/**" />
> 

Damn, did it not?  I can't keep track...

> It's also necessary to download stringtemplate 3.0
> source and move the
> files in org.antlr.stringtemplate into the antlr
> tree. This isn't
> mentioned in the README.

This presumes the antlr jar is trying to be a
standalone, all-inclusive jar.  It's not.  You need ST
on the classpath.

> 
> $ java -jar lib/antlr-3.0ea9.jar org.antlr.Tool
> Exception in thread "main"
> java.lang.NoClassDefFoundError:
> antlr/TokenStream
>         at
> org.antlr.tool.ErrorManager.setLocale(Unknown
> Source)
>         at
> org.antlr.tool.ErrorManager.<clinit>(Unknown Source)
>         at org.antlr.Tool.main(Unknown Source)
> 
> I'm lost as to why this is.
> 

Note the package "antlr".  This is ANTLR2, on which
ANTLR3 (for now) depends.  Yet another candidate for
your classpath.

> Also, the antlr-3.0b7.jar provided also gives out
> the same Main-Class
> error as the one built with ant.
> 

And now you know why.

HTH,
Matt

> Thanks,
> Luke.
> 
> 
> 



 
____________________________________________________________________________________
Looking for earth-friendly autos? 
Browse Top Cars by "Green Rating" at Yahoo! Autos' Green Center.
http://autos.yahoo.com/green_center/


More information about the antlr-interest mailing list