开发者

Installing Ant on Cygwin

开发者 https://www.devze.com 2023-01-18 13:34 出处:网络
I\'m having some trouble figuring out how to install Ant on 开发者_StackOverflow中文版Cygwin.I want to use Ant to build Nutch.I\'ve looked through a bunch of tutorials but I can\'t find anything that

I'm having some trouble figuring out how to install Ant on 开发者_StackOverflow中文版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?


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


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消