Installing Ant on Cygwin

2019-01-22 03:21发布

I'm having some trouble figuring out how to install Ant on Cygwin. I want to use Ant to build Nutch. I've looked through a bunch of tutorials but I can't find anything that is low level enough for me to understand. I need something like...

  1. Download ant, put it here
  2. Open Cygwin
  3. type "export ANT_HOME=..."
  4. ...

Can anyone help me out here?

3条回答
仙女界的扛把子
2楼-- · 2019-01-22 04:02

Here's a step-by-step guide:

  • simply download and unzip ANT binaries say into c:\apache-ant-1.8.1

  • download and unzip NUTCH sources say into: c:\apache-nutch-1.2

  • open the command prompt and run the following:

    cd c:\apache-nutch-1.2
    c:\apache-ant-1.8.1\bin\ant
    

    the same would work from the Bash shell, just use Cygwin-style paths:

    cd /cygdrive/c/apache-nutch-1.2
    ./cygdrive/c/apache-ant-1.8.1/bin/ant
    

That's it, you will find a new directory build containing the output.

For convenience, you might want to add the Ant bin directory to the PATH environment variable so that you don't have to give the full path each time, but that's optional.

BTW I just did those exact steps, and all went fine.

Finally, follow this tutorial to get started.

查看更多
兄弟一词,经得起流年.
3楼-- · 2019-01-22 04:11

In Windows, add the path to your ant /bin directory to the Path system variable. This can easily be done by right clicking on Computer > Properties > Advanced System Settings > Environment Variables, click on Path in the System Variables, click on Edit and add ; followed by the path to your ant bin directory to the end of the Variable value.

Start or restart Cygwin.

Type ant -version The version should be displayed.

查看更多
smile是对你的礼貌
4楼-- · 2019-01-22 04:13

Assuming you have a JDK already installed, you can do this:

$ export ANT_HOME=/cygdrive/c/apache-ant-1.7.1

which assumes you've unzipped Ant into C:\apache-ant-1.7.1. Then:

$ export PATH=$ANT_HOME/bin:$PATH
$ ant -version
Apache Ant version 1.7.1 compiled on June 27 2008
查看更多
登录 后发表回答