【问题标题】:Ant isn't being recognized as a command. Ant 1.7.1Ant 没有被识别为命令。蚂蚁 1.7.1
【发布时间】:2016-05-02 15:08:10
【问题描述】:

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

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

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

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

虽然“ant”仍然无法识别为命令。

这是ANT_HOME的截图:

我的路径是:

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\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 ) 管理引擎组件\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 实用程序 1.5\;C:\Program F文件 (x86)\MySQL\MySQL Fa;%ANT_HOME%\bin;

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

【问题讨论】:

    标签: java ant


    【解决方案1】:

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

    【讨论】:

    • 好吧,这是有道理的。我做了改变。我仍然没有得到认可。 JAVA_HOME 会影响 ant 吗?
    【解决方案2】:

    我进行了更多挖掘,发现我必须将 %ANT_HOME%/bin 添加到我的 系统路径 而不是 用户路径。另外,出于某种原因,Windows 讨厌为 ant 使用长路径。现在可以完美运行了。

    如果有人在他们的构建中遇到困难,我发现了一篇很棒的文章。

    Ant Installation - Web Tutorial

    谢谢大家!!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-07-29
      • 2012-03-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-01-09
      • 1970-01-01
      相关资源
      最近更新 更多