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



我正在尝试使用 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

如何解决此错误?

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

powershell执行此bat文件后,如果我键入"ant -version",则会出现与上述相同的错误。

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

所以我从中了解到,与command prompt不同,powershell不设置本地会话属性。

最新更新