Windows下安裝配置ant
1.ant安裝
請從官網下載ant的*.zip格式的安裝包,
Windows建議下載*.zip版本,
Linux建議下載*.gz版本。
2.配置環境變數
解壓之後,在Windows中配置環境變數,
在系統變數的path後面新增ant的bin目錄的路徑:
D:\GreenProgramFiles\apache-ant-1.9.7\bin
如果有多個配置項,請注意使用; 分隔開;
3.測試命令
進入cmd命令列視窗,
執行如下命令:
ant -v
出現下面結果就說明安裝成功:
Apache Ant(TM) version 1.9.7 compiled on April 9 2016 Trying the default build file: build.xml Buildfile: build.xml does not exist! Build failed
4.問題解決
Ant執行時找不到tools.jar解決方法
命令列輸入ant命令後提示:
“Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre6\lib”;
由於tools.jar在jdk下的lib中,
需要安裝jdk並且設定環境變數,
請參考Windows下安裝配置jdk。