0

即使正确设置了 ANT_HOME、JAVA_HOME 和 PATH 变量,我也无法运行 ant。任何形式的回应表示赞赏。

谢谢!

控制台文本:

C:\Users\Rahul>set ANT_HOME
ANT_HOME=C:\Users\Rahul\Downloads\apache-ant-1.8.4\bin

C:\Users\Rahul>set JAVA_HOME
JAVA_HOME=C:\Program Files\Java\jdk1.7.0_05

C:\Users\Rahul>set PATH
Path=C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Clien
t\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)
\PC Connectivity Solution\;C:\Program Files\Common Files\Microsoft Shared\Window
s Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Wind
ows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowe
rShell\v1.0\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\C
ommon Files\Roxio Shared\OEM\DLLShared\;C:\Program Files (x86)\Common Files\Roxi
o Shared\OEM\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\12.
0\DLLShared\;C:\Program Files (x86)\Roxio\OEM\AudioCore\;C:\Program Files (x86)\
QuickTime\QTSystem\;C:\Program Files (x86)\Android\android-sdk\tools\;C:\Users\R
ahul\Downloads\apache-ant-1.8.4\bin\;c:\Program Files (x86)\Microsoft SQL Server
\90\Tools\binn\;C:\Microsoft SQL Server JDBC Driver 3.0\sqljdbc_3.0\enu\auth\x86
\;C:\Program Files\Java\jdk1.7.0_05\bin\;C:\Program Files\Intel\WiFi\bin\;C:\Pro
gram Files\Common Files\Intel\WirelessCommon\;C:\Users\Rahul\Downloads\apache-an
t-1.8.4\bin\bin;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program F
iles (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files (x86)\Intel\OpenCL SDK\
2.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;G:\adt-bundle-wi
ndows-x86_64\sdk\platform-tools;G:\adt-bundle-windows-x86_64\sdk\tools;C:\Progra
m Files (x86)\Subversion\bin;C:\Users\Rahul\Downloads\apache-ant-1.8.4\bin;C:\Pr
ogram Files\Java\jdk1.7.0_05\bin;C:\Program Files (x86)\OpenVPN\bin;C:\Program F
iles\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\grad
le-1.6-all\gradle-1.6\bin;C:\Program Files (x86)\Google\google_appengine\;C:\Use
rs\Rahul\Downloads\apache-ant-1.8.4\bin;C:\Program Files\Java\jdk1.7.0_05\bin
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC

C:\Users\Rahul>ant
ANT_HOME is set incorrectly or ant could not be located. Please set ANT_HOME.

C:\Users\Rahul>
4

2 回答 2

1

ANT_HOME实际上设置不正确,因为ANT_HOME指向 ant 安装目录的路径是 bin 的父目录。并且您设置了不正确的 bin 路径。

请执行下列操作

ANT_HOME = C:\Users\Rahul\Downloads\apache-ant-1.8.4
于 2013-09-13T06:54:46.507 回答
0

蚂蚁之家应该是

ANT_HOME = C:\Users\Rahul\Downloads\apache-ant-1.8.4

同样在环境变量中编辑路径系统变量并将以下路径添加到它

;C:\Users\Rahul\Downloads\apache-ant-1.8.4\bin

于 2013-09-13T07:03:08.063 回答