键入" ant"如何解决此错误? Git shell中的命令

时间:2015-01-09 06:18:53

标签: git shell ant repository

我正在尝试使用Git shell从Git在我的Windows PC上构建一个存储库。 存储库的名称是“ newrep ”。

当我输入“ ant ”命令时,它会抛出以下错误 -

The term ant is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a patch was included, verify that the path is correct and try again.
At line: 1 char :4 + ant <<<< + CategoryInfo :ObjectNotFound: (ant:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException

如何解决此错误?

1 个答案:

答案 0 :(得分:0)

我有一个bat文件,用于设置ANT_HOME并打印ant -version输出。

bat执行此powershell文件后,如果我输入"ant -version",我会收到与上述相同的错误。

但是,如果我将"ant all"命令添加到同一个bat文件中,并且再次执行bat文件,则command prompt命令执行没有任何问题。

所以我从中理解的是,与powershell不同,{{1}}不会设置本地会话属性。