Hi,
I am trying to run a java class in a step in my Ant script,
and it does NOT work when I set the variable in an external parm file but it DOES work when I set the variable internally.
For example, the following works:
but the following does not:
It generates the following:
Why won't it recognize a variable that's been set in a properties file, even when the values thus set are displayed properly in the echo statement? Admittedly, this is the first time I've tried this with the <java> task vs. <javac>, but I would imagine it should work for both...
any help would be thrilling...
thanks!
dora c
I am trying to run a java class in a step in my Ant script,
and it does NOT work when I set the variable in an external parm file but it DOES work when I set the variable internally.
For example, the following works:
Code:
<property name="javac.path"
value="/projects/install/Antlr/antlr-2.7.2/antlr.jar"/>
...
<target name="processGrammarFile"
depends=""
description="">
<echo message="path: .${javac.path}."/>
<java classname="antlr.Tool"
fork="true">
<arg value="t.g"/>
<classpath path="${javac.path}"/>
</java>
</target>
but the following does not:
Code:
(in common.properties file):
javac.path="/projects/install/Antlr/antlr-2.7.2/antlr.jar"
(in build.xml)
<property name="antlr.home"
value="C:/antlr/home/here"/>
<property file="${antlr.home}/common.properties"/>
...
<target name="processGrammarFile"
depends=""
description="">
<echo message="path: .${javac.path}."/>
<java classname="antlr.Tool"
fork="true">
<arg value="t.g"/>
<classpath path="${javac.path}"/>
</java>
</target>
It generates the following:
Code:
processGrammarFile:
[echo] path: ."/projects/install/Antlr/antlr-2.7.2/antlr.jar". build.xml:processGrammarFile
[java] java.lang.NoClassDefFoundError: antlr/Tool
[java] Exception in thread "main"
[java] Java Result: 1
[echo] done!!!
Why won't it recognize a variable that's been set in a properties file, even when the values thus set are displayed properly in the echo statement? Admittedly, this is the first time I've tried this with the <java> task vs. <javac>, but I would imagine it should work for both...
any help would be thrilling...
thanks!
dora c