【已解决】为docbook环境而配置ant环境使得可以正常运行ant

【问题】

折腾:

【记录】尝试恢复基于cygwin的docbook环境

期间,出现找不到ant的问题。

【解决过程】

1. 参考:

E:\Dev_Root\docbook\tools\ant\apache-ant-1.8.4\INSTALL

中的说明,找到:

http://ant.apache.org/manual/index.html

中的:

Only the bin and lib directories are required to run Ant. To install Ant, choose a directory and copy the distribution files there. This directory will be known as ANT_HOME.

Setup

Before you can run Ant there is some additional set up you will need to do unless you are installing the RPM version from jpackage.org:

  • Add the bin directory to your path.
  • Set the ANT_HOME environment variable to the directory where you installed Ant. On some operating systems, Ant’s startup scripts can guess ANT_HOME (Unix dialects and Windows NT/2000), but it is better to not rely on this behavior.
  • Optionally, set the JAVA_HOME environment variable (see the Advanced section below). This should be set to the directory where your JDK is installed.

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.

2.所以去:

(1)设置ANT_HOME

ANT_HOME=E:\Dev_Root\docbook\tools\ant\apache-ant-1.8.4

add ant home env variable

(2)把bin目录加到path中

path中加上:

%ANT_HOME%\bin;

然后cygwin中,就可以找到ant了:

rm -rf ../output/html/multi/*
=============================== cleaning chm ==============================
rm -rf ../output/htmlhelp/*
=============================== cleaning webhelp ==============================
ant clean
Buildfile: E:\Dev_Root\docbook\dev\books\web_scrape_emulate_login\src\build.xml

clean:

BUILD SUCCESSFUL
Total time: 0 seconds
make[1]: Leaving directory `/cygdrive/e/Dev_Root/docbook/dev/books/web_scrape_emulate_login/src’

E:\Dev_Root\docbook\dev\books>

 

【总结】

修复ant环境,相对比较简单,只是加上ANT_HOME,以及%ANT_HOME%\bin加到path中,基本就行了。



发表评论

电子邮件地址不会被公开。 必填项已用*标注

无觅相关文章插件,快速提升流量