ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robert lazarski <>
Subject Re: Running ant programmatically using API
Date Mon, 11 May 2009 17:24:52 GMT
On Mon, May 11, 2009 at 11:51 AM, Cole, Derek E <> wrote:
> Hi All. If I am creating an ANT project programmatically with the Java
> API, and I want my invoked instance of Ant to have the same classpath as
> my system, how can I do this?
> I have tried a few different things, but none seem to work. If there are
> any javac tasks in my build.xml files, it seems like it cannot find the
> JDK (and in fact, seems to be pointing to some JRE install..even though
> JAVA_HOME is set correctly on the workstation).

fork="false" is the default which is more rigid concerning any vars,
so I'd try fork="true" and see if that helps. I had classpath problems
running ant programatically in unit tests that maven did, so avoid
invoking ant out of maven if you're doing that. Putting these
statements in your compile task may give you some clues:

    <echo message="${}" />
    <echo message="${java.home}" />
    <echo message="${PATH}" />
    <echo message="${java.class.path}" />

Good luck,
- R

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message