How can I install Apache Ant on Mac OS X?

后端 未结 8 1220
难免孤独
难免孤独 2020-12-22 15:22

I tried to install Apache Ant on my Mac and I followed the next steps :

  1. I downloaded apache-ant-1.8.1-bin.tar.gz into my Downloads folder.
相关标签:
8条回答
  • 2020-12-22 15:52

    For MacOS Maveriks (10.9 and perhaps later versions too), Apache Ant does not come bundled with the operating system and so must be installed manually. You can use brew to easily install ant. Simply execute the following command in a terminal window to install brew:

    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    

    It's a medium sized download which took me 10min to download and install. Just follow the process which involves installing various components. If you already have brew installed, make sure it's up to date by executing:

    brew update
    

    Once installed you can simply type:

    brew install ant
    

    Ant is now installed and available through the "ant" command in the terminal.

    To test the installation, just type "ant -version" into a terminal window. You should get the following output:

    Apache Ant(TM) version X.X.X compiled on MONTH DAY YEAR

    Source: Error executing command 'ant' on Mac OS X 10.9 Mavericks when building for Android with PhoneGap/Cordova

    If you are getting errors installing Brew, try uninstalling first using the command:

    rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup
    

    Thanks to OrangeDog and other users for providing additional information.

    0 讨论(0)
  • 2020-12-22 15:54

    If you're a homebrew user instead of macports, homebrew has an ant recipe.

    brew install ant

    0 讨论(0)
提交回复
热议问题