Search Google

Wednesday, February 24, 2010

眉眉角角~

今天終於解決了一個延宕多時的問題 --> 在我的機器上始終無法執行ANT!

C:\Documents and Settings\Administrator>ant
這個時候不應有 Files\Apache。

上Google找了很多次也找了很久始終找不到答案(居然有Google找不到的東西!),
在百般無奈下只好再度把manual翻出來看,終於在仔細研讀後看到了這麼一段話
Windows Note:

The ant.bat script makes use of three environment variables - ANT_HOME, CLASSPATH and JAVA_HOME. Ensure that ANT_HOME and JAVA_HOME variables are set, and that they do not have quotes (either ' or ") and they do not end with \ or with /. CLASSPATH should be unset or empty.

原來是我先前設定的CLASSPATH造成ANT無法執行,於是趕緊在ant.bat的開頭加上
set CLASSPATH=

經測試後終於解決了擱置超過半年的疑案!
C:\Documents and Settings\Administrator>ant
Buildfile: build.xml does not exist!
Build failed
這個故事告訴我們人要在走投無路而且有只能靠自己的覺悟時才會認真看manual。。。