Hi,
I am trying to run a java command using exec task in ant.
I ran into the error because one of the java command argument has space between.
Any idea? Please help.
Thanks,
Here is my ant task in build.xml file:
<exec dir="${temp-dir}" executable="${java}">
<arg value="-jar"/>
<arg value="${tools-dir}/test.jar" />
<arg value="-libraryjars"/>
<arg value="${env.JAVA_HOME}/jre/lib
/rt.jar"/>
<arg
value="-dontusemixedcaseclassnames"/>
<arg
value="-renamesourcefileattribute"/>
<arg value="SourceFile"/>
<arg value="-keepattributes"/>
<arg
value="SourceFile,LineNumberTable"/>
<arg value="@../../../built/temp.pro"/>
<arg value="-injars"/>
<arg value="../../../built/classes"/>
<arg value="-outjars"/>
<arg value="../../..built/temp"/>
<arg value="-printmapping"/>
<arg value="../../../built/teting.txt"/>
</exec>
Here is an output:
[exec] Current OS is Windows XP
[exec] Executing 'C:\Program Files\Java\jdk1.6.0_10\bin\java' with
arguments:
[exec] '-jar'
[exec] '../../../Tools/test.jar'
[exec] '-libraryjars'
[exec] 'C:\Program Files\Java\jdk1.6.0_10\jre\lib\rt.jar'
[exec] '-dontusemixedcaseclassnames'
[exec] '-renamesourcefileattribute'
[exec] 'SourceFile'
[exec] '-keepattributes'
[exec] 'SourceFile,LineNumberTable'
[exec] '@../../../built/temp/temp.pro'
[exec] '-injars'
[exec] '../../../built/temp/classes'
[exec] '-outjars'
[exec] '../../../built/temp/'
[exec] '-printmapping'
[exec] '../../../built/teting.txt'
[exec]
[exec] The ' characters around the executable and arguments are
[exec] not part of the command.
[exec] Error: Expecting class path separator ';' before
'Files\Java\jdk1.6.0_10\jre\lib\rt.jar' in argument number 2
[exec] Result: 1
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]