最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

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

Docbook crifan 2253浏览 0评论

【问题】

折腾:

【记录】尝试恢复基于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中,基本就行了。

转载请注明:在路上 » 【已解决】为docbook环境而配置ant环境使得可以正常运行ant

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
82 queries in 0.192 seconds, using 22.14MB memory