Use of the open-source tool ANT --- general Linux technology under windows-Linux programming and kernel information. The following is a detailed description. I remember that when I first learned java, the teacher introduced this very hanging tool ----- ant. At that time, I didn't feel much about it and thought it was useless. I used it today.
Ah, it's really time to hate books.
OK ,first go to sourceforge.netto download ant, and I download apache-ant-1.6.5.rar, decompress it to d:/java/ant;
1.
Configure ant:
Configure the ant environment variable first (this is really delicious, and the environment variable is taken !)
ANT_HOME
D: \ java \ ant // note that it is the same as your ant directory !!! Note that \
Add the ant bin directory in PATH
; D: \ java \ ant \ bin
Add the ant lib directory to CLASSPATH
; D: \ java \ ant \ lib
2.
Use of ant
Ant has many parameters. useful parameters are as follows:
Compile ant run in cmd
For more information, see ant help.
3.
Create an ant directory
I created the classes directory in e:/mywork/antwork and the src directory build. xml file.
Here, the build. xml file is as follows: // note that the comment should be deleted. I didn't use the xml comment. I personally feel the trouble. It's better to use the c annotation.
// Needless to say
// Current build directory
// Main class name
// Java source file in src
// Class. class File
Ant will automatically compile build. xml!
[Exec] hello world!
Ant's powerful functions are waiting for you to find out!
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.