Q:

Exclipse with ant export jar file as a library for another project

I am new on this. 
Now I am told to build a project A into a jar file. It should be able to be used by another project B. I am told to use ant. I read my post and watch tutorials. I found this tutorial and use its build.xml with just modification of the path. 
http://www.bharaththippireddy.net/2012/02/ant-hands-on_9001.html
Here is what I don't understand. 
1 To use the ant, in the build.xml I have to have classes folder for .class files, so I can make the project B  work after I add the generated A.jar to the build path of B. If I don't generate the .class files (by editing the xml files) it will not work.
2 I could use eclipse simply export A as a jar file and add it to the build path to B then it works too. In this case, I don't generate any .class file. Why I need ant then? Do I miss anything here?

A:

The class files are required to generate the jar. Both options will do the same.
In option 1, you are explicitly telling ant to generate classes and then generate jar using those .class files
In option 2 eclipse will do both, first generate .class files (under gen folder inside the eclipse project) and then build the jar. Also if both projects are in eclipse, you can even specify project B depends on project A under build path Projects tab and no need to explicitly export jar every time library is changed.

