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

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.

主站蜘蛛池模板: 乐昌市| 秀山| 南安市| 北川| 辛集市| 萨嘎县| 固镇县| 平阳县| 密云县| 巴中市| 广德县| 泽库县| 昌吉市| 长海县| 鄯善县| 南川市| 新昌县| 香河县| 汕头市| 新巴尔虎左旗| 蛟河市| 乌兰县| 新沂市| 衢州市| 灵川县| 正定县| 扎鲁特旗| 比如县| 开鲁县| 乳山市| 高陵县| 梅河口市| 龙州县| 古浪县| 宜兰县| 舞钢市| 广元市| 贡嘎县| 衡阳县| 民勤县| 车致|