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

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.

主站蜘蛛池模板: 特克斯县| 营口市| 华阴市| 襄城县| 德安县| 密山市| 南雄市| 陇南市| 铁力市| 永年县| 共和县| 陆河县| 吴江市| 亳州市| 喀喇| 潞西市| 青冈县| 玉门市| 庆安县| 揭东县| 巴林右旗| 丹棱县| 星座| 巴彦淖尔市| 内乡县| 西宁市| 长子县| 灵石县| 彰化市| 巴南区| 南江县| 凤城市| 美姑县| 任丘市| 紫云| 垦利县| 金溪县| 林州市| 漳州市| 建德市| 扎兰屯市|