Ant入门学习一(Ant的安装)

原创
2012/07/19 14:53
阅读数 96

一:Setup

1.Add the bin directory to your path.

2.Set the ANT_HOME environment variable to the directory where you installed Ant. On some operating systems, Ant's startup scripts can guess ANT_HOME (Unix dialects and Windows NT/2000), but it is better to not rely on this behavior.

3.Optionally, set the JAVA_HOME environment variable (see the Advanced section below). This should be set to the directory where your JDK is installed. 

Operating System-specific instructions for doing this from the command line are in the Windows, Linux/Unix (bash), and Linux/Unix (csh) sections. Note that using this method, the settings will only be valid for the command line session you run them in.

Note: Do not install Ant's ant.jar file into the lib/ext directory of the JDK/JRE. Ant is an application, whilst the extension directory is intended for JDK extensions. In particular there are security restrictions on the classes which may be loaded by an extension.

二:Check installation

You can check the basic installation with opening a new shell and typing ant. You should get a message like this

Buildfile: build.xml does not exist!
Build failed
So Ant works. This message is there because you need to write an individual buildfile for your project. With a ant -version you should get an output like

Buildfile: build.xml does not exist!
Build failed

 

简单来说就是:

一、创建环境变量:ANT_HOME = I:\apache-ant-1.8.4

      在Path里面加入:%ANT_HOME%\bin

      确保你电脑里安装了JDK并配置好了环境变量

二、打开命令行窗口,键入ant -version 回车

    C:\Users\wieco>ant -version

    Apache Ant(TM) version 1.8.4 compiled on May 22 2012

    表示咱装成功!

展开阅读全文
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部