Frederic Chalons wrote:
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.

Alternatively, you need a default JVM argument that can be used multiple times and has no side effects, and make that the default.

the -ea option to enable assertions for a package may work there...


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to