Section 11.3. Using a Different Version of Ant


11.3. Using a Different Version of Ant

Eclipse comes with Ant 1.6.1, but it's possible to use a different version. Open the Ant preferences page by selecting Window Preferences Ant Runtime and clicking the Classpath tab.

When Eclipse runs Ant, it looks for the appropriate classes on the Ant classpath, as set in the Ant Home Entries item. To change the Ant Home Entries, click the Ant Home button and choose the Ant installation you wish to use.

If you don't want to change the classpath, you can run Ant as an external tool from Eclipse. To do that, select Run External Tools External Tools to open the External Tools dialog. Click the Program item and then the New button. Enter a name for the new tool (such as "Ant 1.8" or whatever is appropriate). Next, to the Location field, click the Browse File System button and navigate to ant.sh or ant.bat, whichever is right for your operating system, and click Open. The External Tools dialog will reappear; in the Arguments field, enter any arguments you want to pass to Ant. Finally, in the Working Directory field, enter the directory of the build file you want to use and click Run to launch the new version of Ant. The problem with doing this is that you won't have easy access to predefined values that you have while working inside Eclipse. In most cases, it's far better to use Ant from inside Eclipse when building Eclipse projects.




    Ant. The Definitive Guide
    Ant: The Definitive Guide, 2nd Edition
    ISBN: 0596006098
    EAN: 2147483647
    Year: 2003
    Pages: 115
    Authors: Steve Holzner

    Similar book on Amazon

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net