Thursday, October 8, 2009

How to integrate ANT tool with Eclipse IDE?

ANT Eclipse IDE(latest edition of Eclipse IDE is Galileo) integration is a very simple process as summarized in following steps:

1. As a first step, create a Java Project in Eclipse IDE.

2. Associate a build.xml with this project and ensure you put this XML at the same location as shown in package structure in Eclipse IDE :
(Click images to enlarge)


The code of build.xml is as given below:
<?xml version="1.0" ?> <project name="IQJava" default="execute"> <target name="init" depends="clean"> <mkdir dir="build/classes" /> </target> <target name="compile" depends="init"> <javac srcdir="src" destdir="build/classes" /> </target> <target name="execute" depends="compile"> <java classname="com.iqjava.ant.AntExample" classpath="build/classes" /> </target> <target name="clean"> <delete dir="build" /> </target> </project>


3. Run this build XML



4. The output of this execution will look like as given below:


blog comments powered by Disqus
 

Disclaimer
Interview Questions On Java,Java EE Copyright © 2016. Reads: best tracker