ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Tu <...@adobe.com>
Subject ant exec task trouble parsing quotes
Date Tue, 23 Dec 2008 00:42:36 GMT
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: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message