官术网_书友最值得收藏!

Installing Ant

Ant can be downloaded from its official website (http://ant.apache.org). You can download the source or the precompiled version. The easiest way is to download the binary in a tar.gz format.

Whenever you download software from the Internet, it is highly recommended that you check the integrity of the downloaded file. The HTTP protocol does not contain error checking, and it may happen that a network error remains hidden or a malevolent internal proxy modifies the downloaded file. Download sites usually provide checksums for the downloadable files. These are usually MD5, SHA1, SHA512, or some other checksums.

When I downloaded the Apache Ant 1.9.7 version in tar.gz format, I also opened the page that led to the MD5 checksum. The checksum value is bc1d9e5fe73eee5c50b26ed411fb0119.

The downloaded file can be checked using the following command line:
$ md5 apache-ant-1.9.7-bin.tar.gz
MD5 (apache-ant-1.9.7-bin.tar.gz) = bc1d9e5fe73eee5c50b26ed411fb0119
The calculated MD5 checksum is the same as the one on the website, which says that the file integrity is not harmed.
On the Windows operating system, no tool to calculate MD5 digest is included. There is a tool that Microsoft provides, called File Integrity Checksum Verifier Utility, which is available via the page https://support.microsoft.com/en-us/help/841290/availability-and-description-of-the-file-checksum-integrity-verifier-utility. If you use Linux, it may happen that the md5 or md5sum utility is not installed. In that case, you can install it using the command apt-get or whatever installation tool your Linux distribution supports.

After the file is downloaded, you can explode it to a subdirectory using the following command:

    tar xfz apache-ant-1.9.7-bin.tar.gz

The created subdirectory is the usable binary distribution of Ant. Usually, I move it under ~/bin, making it available only for my user on OS X. After that, you should set the environment variable as ANT_HOME to point to this directory and also add the bin directory of the installation to the PATH. To do that, you should edit the ~/.bashrc file and add the following lines to it:

export ANT_HOME=~/bin/apache-ant-1.9.7/ 
export PATH=${ANT_HOME}bin:$PATH

Then, restart the terminal application, or just type . ~/.bashrc and test the installation of Ant by typing the following command:

    $ ant
Buildfile: build.xml does not exist!
Build failed

If the installation was correct, you should see the preceding error message.

主站蜘蛛池模板: 甘谷县| 平阴县| 湖州市| 齐河县| 扶风县| 介休市| 古田县| 井冈山市| 桐柏县| 新密市| 滁州市| 嵊泗县| 望江县| 绥芬河市| 灵石县| 宜州市| 崇义县| 衢州市| 潼关县| 边坝县| 阿拉善左旗| 鄢陵县| 龙游县| 贵州省| 原阳县| 怀安县| 平远县| 盖州市| 新干县| 苍溪县| 绿春县| 太湖县| 武鸣县| 松江区| 石狮市| 类乌齐县| 安庆市| 镇平县| 新密市| 普兰店市| 日照市|