[antlr-interest] Ant build

Matt Benson gudnabrsam at yahoo.com
Mon Feb 11 15:04:59 PST 2008


--- Johannes Luber <jaluber at gmx.de> wrote:

> Matt Benson schrieb:
> > All:  I had thought there were problems with the
> Ant
> > build, but I can no longer locate the emails that
> made
> > me think so.  I had intended to address these; if
> > anyone knows of anything wrong with the existing
> Ant
> > build, please let me know as I've finally gotten
> p4 to
> > allow me to synch up and everything.  In return
> I'll
> > try and put together some annoying lexing
> questions
> > for the list.  ;)
> 
> Can you get the ant-build run successfully on your
> end? I get this error:
> 
> "Buildfile: build.xml
> 
> generator-prepare:
>      [mkdir] Created dir:
> /.../ANTLR/code/antlr/main/codegen
>       [copy] Copying 6 files to
> /.../ANTLR/code/antlr/main/codegen
> 
> generator:
>      [antlr] Exception in thread "main"
> java.lang.NoClassDefFoundError: 
> antlr/Tool
>      [antlr] Caused by:
> java.lang.ClassNotFoundException: antlr.Tool
>      [antlr]     at
>
java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>      [antlr]     at
> java.security.AccessController.doPrivileged(Native 
> Method)
>      [antlr]     at 
>
java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>      [antlr]     at
>
java.lang.ClassLoader.loadClass(ClassLoader.java:306)
>      [antlr]     at 
>
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
>      [antlr]     at
>
java.lang.ClassLoader.loadClass(ClassLoader.java:251)
>      [antlr]     at 
>
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
> 
> BUILD FAILED
> /.../ANTLR/code/antlr/main/build.xml:102: The
> following error occurred 
> while executing this line:
> /.../ANTLR/code/antlr/main/build.xml:55: ANTLR
> returned: 1"
> 
> I suppose the problem is that two grammars are
> already for ANTLR v3, 
> while the others are still for ANTLR 2.7.7.

This means ANTLR 2 is not found for generating files. 
At present you need to install an ANTLR 2 (I use
2.7.7) jar in $ANT_HOME/lib as well as in ./lib. 
Also, stringtemplate.jar needs to be in ./lib.  I'm
going to send Ter an updated buildfile that 1) uses
the ANTLR 2 jar in ./lib for generation so it's not
necessary to add it both places (though it shouldn't
hurt) as well as provides warnings when ANTLR 2 or
stringtemplate is missing.

br,
Matt


> 
> Johannes
> 



      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs


More information about the antlr-interest mailing list