Re: a tricky case of running an executable from an ant build script

Stefan Bodewig <[email protected]> Fri, 25 Dec 2020 17:45:14 +0100
Newsgroups gmane.comp.jakarta.ant.user
Message-ID <[email protected]>
On 2020-12-19, Alan Snyder wrote:

> The case of interest is where I perform the build directly within a Java application process.

[...]

> Is there a way that within my application I can configure ant with a
> different $PATH to provide to the build script, so that it will find
> the executable?

Depends on the way you execute the build. If you are using Runtime.exec
or ProcessBuilder there are ways to specify a custom environment for the
forked process. If you are invoking Ant via its Java API then there is
no way I can think of right now.

Stefan