I have heard back from Sun (that was quick). This is the expected behavior of Runtime.exec(...). That is a little unfortunate. I'll add the documentation update and close the bug report for now.
Conor ----- Original Message ----- From: "Conor MacNeill" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, January 18, 2001 12:46 AM Subject: Re: Dir attribute of the execute task. > Moving this over from ant-user. > > I've done some tests on JDK 1.3's Runtime.exec under NT. It seems a little > inconsistent about how it picks up executables in the specified directory. > I am attaching the code here. I have submitted a bug report on the > developer connection about this inconsistency. I am also interested in > other people's opinions about this. I'm not sure if this is an issue on > Unix systems since normally "." is not implicitly part of the path, as it > is on Win32 systems. > > As it stands, my test build file functions under JDK 1.2 and fails under > JDK 1.3. (Both on NT) > > At the least, we need a documentation update which should state something > like > > The executable attribute should either provide the name of a command on the > user's path or provide the full path to the command to be executed. For > Windows based systems, the executable command should include the file > extension, that is "testit.bat", rather than just "testit" > > Thoughts? > Conor > > > ----- Original Message ----- > From: "Conor MacNeill" <[EMAIL PROTECTED]> > To: <ant-user@jakarta.apache.org> > Sent: Wednesday, January 17, 2001 9:17 AM > Subject: RE: Dir attribute of the execute task. > > > > Andy, > > > > The dir attribute sets the current directory that will be in force when > the > > external command is executed. It does not provide the location of the > > external command. For example, create a batch file in your path, > something > > like > > > > echo Hello > > dir > > > > Now execute this in different directories and you will see the > difference. > > > > Nevertheless, I think this may be a bug in Runtime.exec(...). I'm going > to > > do some tests and see. > > > > Conor > > > > > > -- > > Conor MacNeill > > [EMAIL PROTECTED] > > Cortex eBusiness > > http://www.cortexebusiness.com.au > > > > > -----Original Message----- > > > From: Andrew Goodnough [mailto:[EMAIL PROTECTED] > > > Sent: Wednesday, 17 January 2001 6:31 > > > To: ant-user@jakarta.apache.org > > > Subject: Re: Dir attribute of the execute task. > > > > > > > > > Yes, it works to include the whole path in the executable > > > attribute - but what was the original intention of the dir > > > attribute? The note in the docs will be fine for me as > > > resolution. Thanks. > > > > > > Andy > > > > > > > > > --- Conor MacNeill <[EMAIL PROTECTED]> wrote: > > > > Andy, > > > > > > > > I have looked at this. It seems that the command given > > > > must either be > > > > passed with a full path or it must exist in the path. You > > > > cannot rely on it > > > > just being in the directory where you want to execute it. > > > > > > > > Can you please verify that works, and if so, I will add > > > > something to the > > > > documentation and close the bug report. > > > > > > > > Conor > > --------------------------------------------------------------------------- ----- > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED]