ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Burton" <>
Subject Re: antRun and antRun.bat problems?
Date Sun, 11 Mar 2001 03:41:54 GMT
Hi Sean,

The antRun scripts are used internally by Ant with the <exec> task it it's
subclasses like <execon> and I believe <apply> along with possibly other
tasks.  The sole purpose of these scripts is to change to a different
directory before executing the specified command.  As such you shouldn't
be trying to invoke antRun from the command line as that's not it's
intended purpose.  The antRun scripts are only called by <exec> and
friends when:
  * You are running under Windows 9x/Me or any UNIX/Linux OS and not
running a 1.3 JVM and you specify a "dir" attribute with a value that
resolves to something other than the directory from which Ant was invoked.

They are not called when:
  * You are running with a 1.3 JVM on any platform.  A new version of the
Runtime.exec method in 1.3 supports an argument with the directory in
which the command should be run in.
  * You are running on Windows NT or 2000 under a 1.2.2 JVM.
  * You don't specify a "dir" attribute or do specify one with a value
equivalent to the current directory from which Ant was invoked.

FYI, you can verify how external commands are invoked when running with
the -debug option (on v1.3 or greater).  Any external command executed by
Ant shows up with the line: Execute:FooCommandLauncher: command-to-execute
...  where "Foo" is the name of the inner class of the Execute class
implementing a type of command launcher.  The command shown is
subsequently handed off to Java's Runtime.exec method.  So if the antRun
script is being called, you will see it there as the first argument.

The newline problem was fixed in CVS recently and should be available in a
nightly build of 1.4 Alpha.  Otherwise, you can fix this yourself by using
an editor or utility that supports newline conversion or even Ant's
<fixCRLF> task.


Sean Ogle wrote:
> Has anybody had problems compiling with jikes with respect to ant's use of
> the antRun and antRun.bat files in the ${ANT_HOME}/bin directory? I had to
> re-type the antRun file in linux because it had some embedded characters
> which I couldn't see in Emacs (probably ^A or ^D ?). But now that works and
> I am trying to run my script on Win 2K and it chokes in the antRun.bat file.
> The third line starts with a # character which is supposedly a comment even
> though Win2K uses 'rem' to start comment lines. But even worse, Win2K
> appears to be breaking the classpath up at ; characters!

View raw message