[antlr-interest] Help w/ ANTLR task inside ANT/Netbeans . . .please

Jeff Vincent JVincent at Novell.Com
Mon Feb 11 11:47:23 PST 2002


I should have mentioned that I built a .jar w/ all antlr classes (used
mkdebugjar.bat) copied it to the netbeans directory
"C:\netbeans-3.3.1\modules\patches\org-apache-tools-ant-module" AND into
lib, lib/ext, modules, modules/ext with the same error.
 
It is interesting that it appears to be spawning a new thread/process
using the following command w/ results:

java antlr.Tool -o
H:\Projects\jXPOZ\src\com\novell\ndstest\engine\parser\generatedSource
H:\Projects\jXPOZ\src\com\novell\ndstest\engine\parser\jXPOZLexer.g
Execute:Java13CommandLauncher: java antlr.Tool -o
H:\Projects\jXPOZ\src\com\novell\ndstest\engine\parser\generatedSource
H:\Projects\jXPOZ\src\com\novell\ndstest\engine\parser\jXPOZLexer.g
java.lang.NoClassDefFoundError: antlr/Tool
Exception in thread "main" 
com/novell/ndstest/engine/parser/ParserGen.xml [15] java failed with
return code 1
        at
org.apache.tools.ant.taskdefs.Execute.runCommand(Execute.java:461)
        at
org.apache.tools.ant.taskdefs.optional.ANTLR.execute(ANTLR.java:116)
        at org.apache.tools.ant.Task.perform(Task.java:217)
        at org.apache.tools.ant.Target.execute(Target.java:184)
        at org.apache.tools.ant.Target.performTasks(Target.java:202)
        at
org.apache.tools.ant.Project.executeTarget(Project.java:601)
        at
org.apache.tools.ant.Project.executeTargets(Project.java:560)
        at
org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:277)
        at
org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:118)
BUILD FAILED
Total time: 0 seconds

It doesn't set the class path upon execution of the command which is
why it seems to only recognize the CLASSPATH set in the environment. 
"Java.exe" doesnt know any better, much less anything about Netbeans.

>>> mzukowski at bco.com 02/11/02 10:57AM >>>
antlr.jar does not include the antlr.Tool classes.  It is a jar for
the
runtime classes which a parser built with antlr needs.  Try creating
your
own jar from the antlr directory, then see if that works.

Monty

> -----Original Message-----
> From: Jeff Vincent [mailto:JVincent at Novell.Com] 
> Sent: Monday, February 11, 2002 9:55 AM
> To: antlr-interest at yahoogroups.com 
> Subject: [antlr-interest] Help w/ ANTLR task inside ANT/Netbeans . .
.
> please
> 
> 
> I need some perspective if someone would be so kind as to 
> enlighten me.
> 
> The answers for this specific issue have gone unanswered in my
archive
> searches.
> 
> I am using ANT for the first time within NetBeans 3.3.1 (ANT v1.4.1)
> and am attempting to use the ANTLR optional task.  I have placed
> ANTLR.jar everywhere I can find a .jar file in my NetBeans
> installation,
> including the path specified in the ANT help for optional tasks
> (NBINSTALL/modules/patches/org-apache-tools-ant-module/).
> 
> Regardless of where I put the antlr.jar file, it always says
> "java.lang.NoClassDefFoundError: antlr/Tool".  The only way around
it
> that I have found so far is to open a shell, set my shell
environment
> variable CLASSPATH to point to the antlr.jar and then launch
Netbeans
> from the shell.
> 
> I have tried to set the classpath inside the ANT script, but it
seems
> to ignore it.  It also ignores all my netbeans properties that all
> have
> the antlr.jar included (mounted filesystems).  I can't seem to
> override
> the "java.class.path" property.  It just seems that it is either
> ignoring any properties available when invoking "java" to process my
> .g
> files.
> 
> What do I need to set in order for the ANTLR task to see (and use)
the
> antlr.jar file, short of setting the environment variable?  This
> project
> is shared and I want to put the necessary .jar references in the ANT
> task and not require a bunch of external configuration before
> launching
> netbeans.
> 
> A lot of past e-mail generically refers to setting the ANT classpath
> property for use with the "java" task, setting fork to "yes" and
> passing
> in the new classpath.  If that is the only way of using a
> task-specific
> classpath, what good is the ANTLR task (or any other task that
> requires
> modifications to classpath)?  Traditional makefiles allow building
and
> setting environment variables temporarily without affecting the
global
> environment during the make process.  It seems that so far, ANT
> disallows this.  Why?
> 
> I hope I am missing something simple.
> 
> Thanks,
> 
> Jeff
> 
> 
> 
>  
> 
> Your use of Yahoo! Groups is subject to 
> http://docs.yahoo.com/info/terms/ 
> 
> 
> 

 

Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/ 



 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list