在 bash 中找不到 Ant 命令(Windows 32 位)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/35263221/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Ant command not found in bash (windows 32bit)
提问by Sheena Agrawal
I installed Apache ant using the link http://www.mkyong.com/ant/how-to-install-apache-ant-on-windows/
我使用链接http://www.mkyong.com/ant/how-to-install-apache-ant-on-windows/安装了 Apache ant
I am trying to build my files in git bash.
It shows the following error when I type ant:
我正在尝试在 git bash 中构建我的文件。
当我输入ant时,它显示以下错误:
bash:ant:command not found
I want to use cd build
command.
我想使用cd build
命令。
采纳答案by VonC
Check your PATH when you are in the bash session.
在 bash 会话中检查您的 PATH。
echo $PATH
Don't forget that, after updating the PATH as mentioned in your link (through the Environment variable control panel), you need to open a newCMD session and launch git-bash.exe
in order for that session to inherit the modified PATH.
不要忘记,在更新链接中提到的 PATH 后(通过环境变量控制面板),您需要打开一个新的CMD 会话并启动git-bash.exe
,以便该会话继承修改后的 PATH。
cd c:\path\to\git
git-bash.exe
echo $PATH
The OP confirms in the comment that the PATH is now:
OP 在评论中确认 PATH 现在是:
d/Users/h169717/bin:/mingw32/bin:/usr/local/bin:/usr/bin:/bin/:/mingw32/bin:/us???r/bin:/d/Users/h169717/bin:/c/Program Files/apache-ant-1.9.6/bin:/c/Program Files/Java/jre1.8.0_72/bin:/c/Program Files/apache-ant-1.9.6/bin:/usr/bin/vendor_perl:/usr/bin/core_perl
d/Users/h169717/bin:/mingw32/bin:/usr/local/bin:/usr/bin:/bin/:/mingw32/bin:/us???r/bin:/d/Users/h169717/ bin: /c/Program Files/apache-ant-1.9.6/bin:/c/Program Files/Java/jre1.8.0_72/bin:/c/Program Files/apache-ant-1.9.6/bin:/ usr/bin/vendor_perl:/usr/bin/core_perl
And ant
is working.
并且ant
正在工作。