To build the .jar file with Ant:
1.In the Package Explorer view of Eclipse, click the build.xml file available directly in the project root.
2.On the Run menu, click Run.
3.In the Run As dialog box, two possible options to run the Ant build file are displayed. If you choose the first option, Eclipse launches the Ant build with the default settings. If you choose the second option, you can change the settings of the Ant build before launching it. Select the second option.
4.Click to enable the targets that you wish to include in the Ant build. In this example, the targets test and jar are selected.
5.Click Run. Eclipse executes the Ant build file and displays the result in the Console view.