A common way for a project directory:
MyProject <dir>
|--lib <dir>--Library Directory
|--classes <dir>--Destination file directory
|--SRC <dir>--Source Files directory
|--doc <dir>--API Documents Directory
|--build.xml
In this way, you can throw the desired. jar file into the Lib directory, and then if you are lazy like me, you can compile it with the following build.xml.
----------
<project name= "basedir="./"default=" C ">
<path id= "P" >
<fileset dir= "lib/" >
<include name= "**/*.jar"/>
</fileset>
</path>
<target name= "C" depends= "" >
<javac srcdir= "src" destdir= "classes" classpathref= "P"/>
</target>
</project>
----------
Description
The first paragraph defines the path p and joins all. jar files under Lib.
The second paragraph calls Javac, specifies that classpath is the previously defined p, compiles all the. java files under the SRC directory, and then puts the. class file into the classes directory after success.
How to run Ant:
Open the Command Line window, enter the directory where Build.xml is located, and enter Ant
For more information, please refer to
http://ant.apache.org download Ant and unzip it, open ant/docs/index.html, select Manual->ant tasks->core tasks in the menu to learn the usage of the other core task
After you download Ant and unzip it, open ant/docs/index.html and select Manual->ant tasks->core tasks in the menu to learn the usage of the other core task
trackback:http://tb.blog.csdn.net/trackback.aspx?postid=305559