2016-12-13 58 views
0

我已經在我的Mac上下載了最後一個apache ant版本,但版本似乎是舊版本。 有什麼想法?Mac Apache Ant版本1.8.2而不是1.9.6

myMac:~ mauri$ brew install ant 
==> Downloading https://homebrew.bintray.com/bottles/ant-1.9.7.el_capitan.bottle.tar.gz 
######################################################################## 100,0% 
==> Pouring ant-1.9.7.el_capitan.bottle.tar.gz 
    /usr/local/Cellar/ant/1.9.7: 1,611 files, 34.9M 
myMac:~ mauri$ 
myMac:~ mauri$ ant -version 
Apache Ant(TM) version 1.8.2 compiled on December 20 2010 
myMac:~ mauri$ 
myMac:~ mauri$ ./Downloads/apache-ant-1.9.6/bin/ant -version 
Apache Ant(TM) version 1.8.2 compiled on December 20 2010 
myMac:~ mauri$ uname -a 
Darwin myMac 15.6.0 Darwin Kernel Version 15.6.0: Mon Aug 29 20:21:34 PDT 2016; root:xnu-3248.60.11~1/RELEASE_X86_64 x86_64 

這裏是相對的導出變量。

myMac:~ mauri$ export ANT_HOME=/Users/mauri/Downloads/apache-ant-1.9.6 
myMac:~ mauri$ export CLASSPATH=$ANT_HOME/lib:$CLASSPATH 
myMac:~ mauri$ export PATH=$ANT_HOME/bin:$PATH 
myMac:~ mauri$ ant -version 
Apache Ant(TM) version 1.8.2 compiled on December 20 2010 
myMac:~ mauri$ /Users/mauri/Downloads/apache-ant-1.9.6/bin/ant -version 
Apache Ant(TM) version 1.8.2 compiled on December 20 2010 
myMac:~ mauri$ which ant 
/Users/mauri/Downloads/apache-ant-1.9.6/bin/ant 
myMac:~ mauri$ 

這裏再多一個命令的核心任務是什麼意思?

myMac:〜馬利$螞蟻-diagnostics

------- Ant diagnostics report ------- 
Apache Ant(TM) version 1.8.2 compiled on December 20 2010 

------------------------------------------- 
Implementation Version 
------------------------------------------- 
core tasks  : 1.8.2 in file:/Library/Java/Extensions/selenium-html-runner-3.0.1.jar 

------------------------------------------- 
ANT PROPERTIES 
------------------------------------------- 
ant.version: Apache Ant(TM) version 1.8.2 compiled on December 20 2010 
ant.java.version: 1.7 
Is this the Apache Harmony VM? no 
Is this the Kaffe VM? no 
Is this gij/gcj? no 
ant.core.lib: /Library/Java/Extensions/selenium-html-runner-3.0.1.jar 
ant.home: /usr/local/Cellar/ant/1.9.7 

------------------------------------------- 
ANT_HOME/lib jar listing 
------------------------------------------- 
ant.home: /usr/local/Cellar/ant/1.9.7 
No such directory. 

------------------------------------------- 
USER_HOME/.ant/lib jar listing 
------------------------------------------- 
user.home: /Users/mauri 
No such directory. 

我試圖卸載並從BREW再次安裝ANT,但問題還是一樣

myMac:OrgSight mauri$ brew uninstall ant 
Uninstalling /usr/local/Cellar/ant/1.9.7... (1,611 files, 34.9M) 
myMac:OrgSight mauri$ brew install ant 
==> Downloading https://homebrew.bintray.com/bottles/ant-1.9.7.el_capitan.bottle.tar.gz 
Already downloaded: /Users/mauri/Library/Caches/Homebrew/ant-1.9.7.el_capitan.bottle.tar.gz 
==> Pouring ant-1.9.7.el_capitan.bottle.tar.gz 
    /usr/local/Cellar/ant/1.9.7: 1,611 files, 34.9M 
myMac:OrgSight mauri$ which ant 
/usr/local/bin/ant 
myMac:OrgSight mauri$ ant -version 
Apache Ant(TM) version 1.8.2 compiled on December 20 2010 
myMac:OrgSight mauri$ /usr/local/Cellar/ant/1.9.7/bin/ant -version 
Apache Ant(TM) version 1.8.2 compiled on December 20 2010 
+0

不知道,你應該仍然能夠下載特定的版本並手動安裝,我相信。 – Rao

+0

你能發佈的'這ant'and'釀造環節輸出-v ant' – Tim

+0

'myMac:〜馬利$釀造鏈接-v螞蟻 提個醒G:已經鏈接:/usr/local/Cellar/ant/1.9.7 要重新鏈接:沖泡斷開鏈接螞蟻&&釀造環節螞蟻 myMac:〜馬利$該螞蟻 在/ usr/local/bin目錄/ ant' @蒂姆 – Mauri

回答

0

我還在努力背後的原因,但如果存在Ant的包裝腳本來源的一些文件在/ etc,所以全球的安裝可能會泄漏到您的設置不考慮。我想關鍵是

core tasks : 1.8.2 in 

文件:/Library/Java/Extensions/selenium-html-runner-3.0.1.jar」 - 有 放硒有什麼,它的優先級 我要感謝。從Apache Ant的斯特凡Bodewig爲這個偉大的洞察力

myMac:~ mauri$ cd /Library/Java/Extensions 
myMac:Extensions mauri$ l 
total 30536 
[email protected] 1 root wheel 15M 4 Dez 12:12 selenium-html-runner-3.0.1.jar 
myMac:Extensions mauri$ mv selenium-html-runner-3.0.1.jar ~/ 
myMac:Extensions mauri$ which ant 
/Users/mauri/Downloads/apache-ant-1.9.6/bin/ant 
myMac:Extensions mauri$ ant -version 
Apache Ant(TM) version 1.9.6 compiled on June 29 2015 
0

我中東歐後實現在帖子中,您嘗試安裝ant,它已下載ant 1.9.7版本,並且提取似乎爲/usr/local/Cellar/ant/1.9.7

或者你可以使用下載目錄中是/Users/mauri/Downloads/apache-ant-1.9.6

因此,所有你需要做的是將環境變量設置爲正確的安裝路徑。

在終端上運行以下命令。

export ANT_HOME=/Users/mauri/Downloads/apache-ant-1.9.6 
export CLASSPATH=$ANT_HOME/lib:$CLASSPATH 
export PATH=$ANT_HOME/bin:$PATH 

現在ant -v應該給正確的結果。

注意上面的變化只在命令會話。如果您想永久應用它,請更新~/.bash_profile文件中的相同內容。

UPDATE:
如果IS仍繼續存在(即,指的是舊版本的螞蟻),它可能有軟鏈接到舊版本。嘗試刪除。

+0

'myMac:〜馬利$出口ANT_HOME =在/ usr /本地/庫/ ANT/1.9.7 myMac:〜馬利$出口CLASSPATH = $ ANT_HOME/lib:$ CLASSPATH myMac:〜mauri $ export PATH = $ ANT_HOME/bin:$ PATH myMac:〜mauri $ myMac:〜mauri $ ant -version Apache Ant(TM)1.8.2版編譯於2010年12月20日 myMac:〜馬利$ '' – Mauri

+0

myMac:〜馬利$ LS /usr/local/Cellar/ant/1.9.7 INSTALL_RECEIPT.json \t許可\t \t \t注意\t \t \t自述\t \t \t bin \t \t \t libexec myMac:〜mauri $' – Mauri

+0

您需要使用適當的下載目錄路徑。也許你可以使用目錄'/ Downloads/apache-ant-1.9.6'作爲'ant home'。請嘗試重新導出所有變量或在新的終端上。 – Rao