ANT API – JAVA_HOME and non-standard build files

Introduction

I’ve been working with the ANT API whilst putting together a build tool (long story) recently. There isn’t a whole lot of documentation available on the ‘net (in fact, there’s explicitly little documentation in cases),  so here are two things that took me a moment or two to work out.

Issues

Non-standard build.xml

For various reasons, our build XML is called builder.xml  – this worked fine up until the first javac  call, following which ANT began looking for build.xml .

To correct this, you can set the ant.file  property to correctly specify your build file.

 

JAVA_HOME not set

Next, the ANT Java API insisted that my JAVA_HOME wasn’t set. I was fairly certain that it was.

After reading the message with somewhat more comprehension, I realized that I just needed to include tools.jar on the command line. Issue sorted.

Build Code

For anyone looking for the actual build code,

 

Tagged with: , , ,
Posted in Uncategorized

Leave a Reply