Tool: install and configure ant (Windows)

Source: Internet
Author: User

1. Download: Go to the ant official website http://ant.apache.org/to download the latest version.
2. Configure environment variables: My computer ---- properties ----- advanced ---- Environment Variables
For example, ant_home: C: \ apache-ant-1.7.1
Path: % ant_home % \ bin (to facilitate operations in the DOS environment)
3. Check whether the installation is successful: Enter the ant command in the DOS window. If the result is displayed
Buildfile: Build. XML does not exist!
Build failed
It indicates that ant has been installed successfully! Because ant runs the build. xml file by default, this file needs to be created.
4. Usage:
(1) Create build. xml1 in the root directory of drive d <? XML version = "1.0" encoding = "GBK"?>
2 <project
Name = "test script" default = "copyfile" basedir = "."
>
3 <target name = "copyfile">
4 <copy file = "D:/a.txt" todir = "E:/Temp"
Overwrite = "true"
/>
5 </Target>
6 </Project>

(2) Create the.txt file under the d directory.
(3) Enter dos,
D:
Ant

In this case, the aa.txt file can be found in the E:/tempvisual directory. The content is the same as a.txt, that is, the file is copied successfully!

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.