On Mon, May 11, 2009 at 11:51 AM, Cole, Derek E <derek.e.c...@lmco.com> 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="${ant.java.version}" /> <echo message="${java.home}" /> <echo message="${PATH}" /> <echo message="${java.class.path}" /> Good luck, - R --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@ant.apache.org For additional commands, e-mail: user-h...@ant.apache.org