Ant's Download and installation

Source: Internet
Author: User
Tags md5 valid tomcat
Is it a little strange to see this headline--not to say MyBatis study notes, how to get ant. Don't worry, please allow me to slow down the road.

MyBatis is another excellent ORM framework. Considering that it may be used later, it is decided to study ahead of time for a rainy day. In order to urge themselves to study, but also in order to summarize in a timely manner, and share with you, recently prepared to write a MyBatis study Notes series blog. Please be interested in a lot of friends to pay attention to, urge and criticize correct. greatly appreciated.

The author does not use any IDE tools in the My book " hand-written first hibernate program " and " the improvement of the first hibernate program written by hand " Two simple hibernate programs are written, compiled, and run with an ordinary text editor and related commands. Although this can help to clarify the mechanism of the operation of the program, but the steps are too cumbersome, long-term so write a program will certainly waste a lot of time. So is there an effective tool that can help us do the repetitive, tedious work. Yes, Ant is an excellent "lightweight" tool to accomplish this task. It's lightweight because it's a command-line tool that's small and not as large as an IDE like eclipse. In MyBatis's learning process, I will use ant to manage my own projects. For this reason, use two blog to introduce Ant's simple usage as a preparation and hope to help friends who want to learn about ant. This article describes how to install and configure ant under Windows XP (similar to Windows 7).

one, ant's Download

Ant is an Apache project (http://ant.apache.org/), and the current version is 1.8.4 (http://ant.apache.org/bindownload.cgi). We download Apache-ant-1.8.4-bin.zip, which is a compression format commonly used under Windows. Apache recommends verifying the integrity of your files after downloading, so you can use tools such as Hashcalc or winmd5sum to verify your files. On the download page, click on the "PGP" link on the back of the file to get the corresponding verification data. If you click "MD5", you can get the MD5 value of the file. Here is an example of winmd5sum to verify the integrity of the file. As shown in the following illustration:

Click on the "Compare" button to compare two MD5 values. If the two are equal, the following dialog box pops up:

This indicates that the file has not been compromised.

Ii. installation and configuration of Ant

Ant's installation is to unzip the downloaded compressed package to the appropriate directory, where I unzip it to the D drive. After decompression, the following figure shows:

As the image above shows, this directory name is too long, so readers can change it to a simple directory name according to their hobbies. The next step is to configure the environment variables required to run ant. Ant run requires java_home environment variable (the value of the Java_home variable is the JDK installation directory, the author's machine is D:\Java\jdk1.6.0_29. Configured in the same way as Ant_home, catalina_home), and configure its own ant_home environment variable, the value of this variable is the ant's installation directory. Here, of course, is "D:\apache-ant-1.8.4". and configuring Tomcat's Catalina_home Environment variables (about Catalina_home environment variables, readers can refer to the author's blog " Windows path and other environmental variablesin detail"), we right-click on "My Computer", click " Properties, advanced, environment variables, the Environment Variables window opens. Here, we can configure the required environment variables. Generally we are logged in to Windows as "Administrator", so the top half of this window is "Administrator User variables". Click the "New", "edit", and "delete" buttons in the upper section to configure the administrator environment variables. Windows is designed as a multiuser system, where the "Administrator user variable" is set, only valid for administrator. If there are other users in the system (which should be rare at this time), and you want the environment variables set to be valid for all users, click the "new", "edit", and "delete" buttons in the lower part of this window to configure the appropriate environment variables.

Let's configure the environment variables for administrator. Click on its "new" button, which pops up the "New User Variable" window, fill in "Variable name" in "Ant_home", "Variable Value" in the previous "D:\apache-ant-1.8.4", as shown in the following image:

Click "OK".

Running Ant is primarily a ant.bat that runs in the bin directory (in this case, D:\apache-ant-1.8.4\bin) in the ant installation directory. Here, you may have guessed: in order to be able to run it in any directory, we need to add this bin directory to the PATH environment variable (for the PATH environment variable, the reader can refer to the author's blog "Windows path and other environmental variablesin detail"). In the Environment Variables window, let's configure the PATH environment variable for the administrator user. In the "Variables" column, locate the path variable and click the "Edit" button, which pops up the "Edit User Variables" window. At the end of the variable value, add the following value:%ant_home%\bin (Place the ant_home between the two percent signs, indicating that the value is to be removed so that the full path to the bin directory can be calculated automatically.) One of the benefits of setting the ANT_HOME environment variable is that if you change the ant installation directory, you only need to modify the Ant_home, the full path to the new bin directory can be calculated automatically, without having to manually modify the PATH environment variable, and Catalina_ The home environment variable is consistent), and note that the preceding value is separated by a semicolon (;) in English. As shown in the following illustration:

(Note that the bin directory of the JDK is also added to the path using the%java_home%\bin method)

"OK", close all windows, that is, configuration complete. Open a command-line window (the previously opened command-line window cannot take effect), run the following command: Ant-version. You can print out the version information for Ant, as shown in the following illustration:

Indicates that ant is installed and configured successfully. Run the command ant-help to display the help information for the ant command.

Summary: We need to learn the knowledge seems to be a lot, but as long as the understanding of the principle, good inductive summary, you can do extrapolate, greatly improve the efficiency and quality of learning. For example in this article, as long as the meaning of the PATH environment variable is clear, compared to the JDK Java_home and Tomcat Catalina_home and their respective path modification, ant installation and configuration is easy to understand and grasp.

This article describes the installation and configuration of ant, and the next blog post will show you how to use ant to create a simple project.

preparation for the "MyBatis Study Notes" series: Ant Download and installation

preparation of the "MyBatis study Notes" Series II: Ant Getting Started example

one of the "MyBatis Study Notes" series: MyBatis Getting Started sample

"MyBatis Study Notes" series bis: MyBatis additions and deletions example

"MyBatis Study Notes" Series III: MyBatis's Association example

"MyBatis Study Notes" series Four: two forms of MyBatis Association

"MyBatis Study notes" series of Five: MyBatis and spring Integration examples

"MyBatis Study Notes" Series VI: MyBatis and Spring integration examples continued

"MyBatis Study notes" series VII: MyBatis one-to-many bidirectional association

"MyBatis Study notes" series of Eight: MyBatis mapperscannerconfigurer configuration

"MyBatis Study Notes" Series IX: Two forms of MyBatis collection

"MyBatis Study Notes" series of ten: MyBatis log log4j Example

xi. "MyBatis Study Notes" series: an example of annotated mode of MyBatis multi-parameter transfer

"MyBatis Study Notes" series 12: mybatis example of the default naming method for multi-parameter delivery

"MyBatis Study Notes" series 13: Example of map mode of MyBatis multi-parameter transfer

"MyBatis Study Notes" series 14: N+1 Problems in MyBatis

the "MyBatis Study Notes" series: a hybrid approach to mybatis multi-parameter transfer

"MyBatis Study Notes" series 16: Spring Declarative Transaction Management Example

"MyBatis Study Notes" series 17: MyBatis Many-to-many save example

An explanation of environment variables such as Windows path

Write the first hibernate program purely by hand

improvements to the "first hibernate program written purely by hand"

This article is from the "Xiaofan column" blog, make sure to keep this source http://legend2011.blog.51cto.com/3018495/888848

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.