Thanks Bill,

After much digging through the code I discovered these facts for myself. I
was still having problems with ant and jikes on Win2K though so I changed my
version of the code to run the Runtime.exec() method with "cmd /c" inserted
into the beginning of the command string. Everything works fine now.

Sean

-----Ursprungliche Nachricht-----
Von: Bill Burton [mailto:[EMAIL PROTECTED]]
Gesendet: Sonntag, 11. Marz 2001 04:42
An: [EMAIL PROTECTED]
Betreff: Re: antRun and antRun.bat problems?


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.

-Bill

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!

Reply via email to