You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Ben Tu <bt...@adobe.com> on 2008/12/23 01:42:36 UTC

ant exec task trouble parsing quotes

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


RE: ant exec task trouble parsing quotes

Posted by Harnack Frank <Fr...@bitmarck.de>.
Hello,

you should try the java-Task.


Regards

Frank

-----Original Message-----
From: Ben Tu [mailto:btu@adobe.com] 
Sent: Tuesday, December 23, 2008 1:43 AM
To: Ant Users List
Subject: ant exec task trouble parsing quotes

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


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