- Java 9 Programming By Example
- Peter Verhas
- 368字
- 2021-07-02 23:37:30
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.
- UNIX編程藝術
- Python程序設計教程(第2版)
- Python數據分析入門與實戰
- Microsoft Application Virtualization Cookbook
- Java面向對象思想與程序設計
- Interactive Data Visualization with Python
- 實用防銹油配方與制備200例
- HTML5+CSS3網站設計教程
- Rust Essentials(Second Edition)
- SharePoint Development with the SharePoint Framework
- Julia for Data Science
- Scala編程實戰
- 小程序從0到1:微信全棧工程師一本通
- 超簡單:用Python讓Excel飛起來(實戰150例)
- Julia High Performance(Second Edition)