Ant并未被识别为命令。 Ant 1.7.1

时间:2016-05-02 15:08:11

标签: java ant

我一直在尽我所能解决这个问题。虽然我似乎无法弄清楚这一点。

首先,我想分享我所阅读和尝试过的内容:

我读过这篇文章:‘ant’ is not recognized as an internal or external command

我还阅读了文档:ant.apache.org/manual/install.html

虽然" ant"仍然没有认出是一个命令。

以下是ANT_HOME的屏幕截图:

enter image description here

enter image description here

我的道路是:

C:\Windows\system32\WindowsPowerShell\v1.0\;C:\oraclexe\app\oracle\product\11.2.0\server\bin;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Dell\DW WLAN Card;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Shoreline Communications\ShoreWare Client\;C:\Program Files (x86)\Shoreline Communications\ShoreWare Client\win64;C:\Program Files (x86)\IBM\Client Access\Emulator;C:\Program Files (x86)\IBM\Client Access\Shared;C:\Program Files (x86)\IBM\Client Access\;C:\Program Files\nodejs\;C:\Program Files (x86)\MySQL\MySQL Fabric 1.5 & MySQL Utilities 1.5\;C:\Program Files (x86)\MySQL\MySQL Fa;%ANT_HOME%\bin;

C:\ Windows \ System32下\ WindowsPowerShell \ V1.0 \; C:\ oraclexe \应用\ ORACLE \产品\ 11.2.0 \服务器\ BIN; C:\ ProgramData \甲骨文\爪哇\ javapath; C:\ Program Files \ Dell \ DW WLAN卡; C:\ Program Files(x86)\ Intel \ iCLS Client \; C:\ Program Files \ Intel \ iCLS Client \; C:\ Windows \ system32; C:\ Windows; C: \ Windows \ System32 \ Wbem; C:\ Windows \ System32 \ WindowsPowerShell \ v1.0 \; C:\ Program Files \ Intel \ Intel(R)Management Engine Components \ DAL; C:\ Program Files \ Intel \ Intel(R )管理引擎组件\ IPT; C:\ Program Files(x86)\ Intel \ Intel(R)管理引擎组件\ DAL; C:\ Program Files(x86)\ Intel \ Intel(R)管理引擎组件\ IPT; C :\ Program Files(x86)\ Shoreline Communications \ ShoreWare Client \; C:\ Program Files(x86)\ Shoreline Communications \ ShoreWare Client \ win64; C:\ Program Files(x86)\ IBM \ Client Access \ Emulator; C: \ Program Files(x86)\ IBM \ Client Access \ Shared; C:\ Program Files(x86)\ IBM \ Client Access \; C:\ Program Files \ nodejs \; C:\ Program Files(x86)\ MySQL \ MySQL面料1.5& MySQL Utilities 1.5 \; C:\ Program Files(x86)\ MySQL \ MySQL Fa;%ANT_HOME%\ bin;

一切似乎都是正确的。虽然我无法弄清楚为什么它不作为命令运行的问题。任何帮助表示赞赏。

2 个答案:

答案 0 :(得分:1)

%ANT_HOME%应该是ANT所在的文件夹,因此应该是c:\apache-ant-1.7.1而不是bin目录。您的路径指向%ANT_HOME%\bin,这在正常情况下似乎是正确的,但它不起作用,因为在您的情况下它实际上指向c:\apache-ant-1.7.1\bin\bin ...

答案 1 :(得分:0)

我做了更多挖掘,我发现我必须将%ANT_HOME%/ bin添加到系统路径而不是用户路径。由于某些原因,加上Windows讨厌使用长路径的蚂蚁。它现在完美无缺。

如果有人卡在他们的构建上,我发现了一篇很棒的文章。

Ant Installation - Web Tutorial

谢谢大家!!

相关问题