You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2002/05/12 01:10:38 UTC

DO NOT REPLY [Bug 9002] New: - exec behaves strange

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9002>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9002

exec behaves strange

           Summary: exec behaves strange
           Product: Ant
           Version: 1.5Beta1
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Core tasks
        AssignedTo: ant-dev@jakarta.apache.org
        ReportedBy: lothar.hegebart@naiads.org


I have the following target

	<target name="tapi" depends="compile">
		<exec executable="javah">
			<arg value=' -classpath R:\Development\ETB-
admin\build ' />
			<arg value=' -d src ' />
			<arg value=' pkgname.CallHandler ' />
		</exec>
	</target>

and the class-file pkgname.CallHandler is available in the build-dir. When i 
execute it with ant -v tapi i get this error

tapi:
     [exec] Current OS is Windows 2000
     [exec] Executing 'javah' with arguments:
     [exec] ' -classpath R:\Development\ETB-admin\build '
     [exec] ' -d src '
     [exec] ' de.steilmann.etb.ressources.CallHandler '
     [exec] The ' characters around the executable and arguments are
     [exec] not part of the command.
     [exec] Error: Class  -classpath R:\Development\ETB-admin\build  could not 
be found.
     [exec] Result: 15

when i use as target

	<target name="tapi" depends="compile">
		<exec executable="javah">
			<arg value='-classpath R:\Development\ETB-
admin\build' />
			<arg value='-d src' />
			<arg value='pkgname.CallHandler' />
		</exec>
	</target>

without the leading and trailing spaces i get 

tapi:
     [exec] Current OS is Windows 2000
     [exec] Executing 'javah' with arguments:
     [exec] '-classpath R:\Development\ETB-admin\build'
     [exec] '-d src'
     [exec] 'pkgname.CallHandler'
     [exec] The ' characters around the executable and arguments are
     [exec] not part of the command.
     [exec] Error: -classpath R:\Development\ETB-admin\build is an illegal 
argument

     [exec] Usage: javah [options] <classes>

     [exec] where [options] include:

     [exec]     -help                 Print this help message
     [exec]     -classpath <path>     Path from which to load classes
     [exec]     -bootclasspath <path> Path from which to load bootstrap classes
     [exec]     -d <dir>              Output directory
     [exec]     -o <file>             Output file (only one of -d or -o may be 
used)
     [exec]     -jni                  Generate JNI-style header file (default)
     [exec]     -old                  Generate old JDK1.0-style header file
     [exec]     -stubs                Generate a stubs file
     [exec]     -version              Print version information
     [exec]     -verbose              Enable verbose output
     [exec]     -force                Always write output files

     [exec] <classes> are specified with their fully qualified names (for
     [exec] instance, java.lang.Object).

     [exec] Result: 15

This behaviour takes place independent of using " and ', my guess would be that 
the exec implementation fools around with the arg values and the spaces 
contained in it and/or the order of the args is mishandled.

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>