ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frederic Chalons <frederic.chal...@hsoftware.com>
Subject problem with java task attribute jvmarg when value is ""
Date Thu, 29 Dec 2005 12:41:25 GMT
Hi,

My problem involved the attribute jvmarg set to a property which value 
is ""...

Using Ant 1.6.4, I am using the java task to launch various process:

    /        <java classname="${classname}">/
    /            <arg value="${arg1}" />/
    /            <arg value="${arg2}" />/
    /            <jvmarg value="${jvmarg1}" />/
    /            <jvmarg value="${jvmarg2}" />/
    /        </java>/

For each class the properties (arg1, arg2, jvmarg1, jvmarg2,etc. ) are 
loaded from xml file.
After that, for each undefined property, its value is set to "".
As a property cannot be overwritten, it behaves as defining a default value.

This is working fine as long as jvmarg1 & jvmarg2 properties have a 
value but breaks when they use "" as default value.
Running ant -debug gives the following:

    /''/
    /''/

    /The ' characters around the executable and arguments are/
    /not part of the command./
    /     [java] Exception in thread "main" java.lang.NoClassDefFoundError:/

    /BUILD FAILED/

It seems that empty jvmarg is the caused but I need to find a way to 
inhibit jvmarg attribute when the associated property is not used.

This basically, the same problem as mentionned at this link:
http://www.jguru.com/forums/view.jsp?EID=1275301
But the switch/case-like solution given is not flexible enough for my needs.

Hope somebody faced & solved this issue before ;)

Thank you,
Frederic CHALONS

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message