Using a different version of Ant
The Eclipse platform provides Ant 1.7.1 as a plug-in library. When running
an Ant buildfile in the Workbench, version 1.7.1 is used by default. It is possible
to use different versions, although they are not supported. There are at least
two ways of using a different version of Ant:
- Changing the Ant runtime classpath:
- When Ant runs a buildfile, it looks for the necessary classes on the Ant classpath.
The Ant classpath consists of the plug-ins contributing new tasks, types or
libraries, plus the classpath defined in the Ant runtime classpath preferences. To
access the preferences, click
Window > Preferences > Ant > Runtime.
The JARs related to Ant 1.7.1 are grouped under the Ant Home Entries item.
To change the Ant Home entries, click on the Ant Home... button and choose the Ant
installation you wish to use.
After you change the Ant classpath, all future Ant builds will use the updated
version instead of the default. To restore the Ant classpath to its original
state, Restore Defaults button on the preference page.
- Using Ant as an external tool:
- When changing the Ant classpath is not an option, or if you just want to test
a newer or beta version of Ant, using it as an external tool is an option.
Usually when it is running in the Workbench, the Ant buildfile
itself is considered to be a external tool, but this is not the only way.
To install a binary distribution of Ant as an external tool (Note:
These steps are for Windows, but similar methods can be used for other operating systems):
- Download and install the binary version of Ant from
Run > External Tools > External Tools....
- Click Program
- Click New.
- Enter a name for your external tool (for example, External Ant).
- For the Location field, click Browse File System.
- Find and select a file called
ant.bat (it should be
bin folder of your Ant installation).
- In the Arguments field enter the arguments for your
buildfile that would normally enter for running the buildfile outside of the
- In the Working Directory field enter the directory of your buildfile.
- Click Run to execute the buildfile.
When you run Ant as an external tool, none of the tasks or types
contributed by Eclipse will work. Also, the Ant classpath preference has no
effect in the buildfile execution.
Running Ant buildfiles
Running external tools
Modifying the Ant classpath
Adding new Ant tasks and types