即使正确设置了ANT_HOME、JAVA_HOME和 PATH 变量,我也无法运行 ant。任何回应都值得赞赏。
谢谢!
控制台文本:
C:UsersRahul>set ANT_HOME
ANT_HOME=C:UsersRahulDownloadsapache-ant-1.8.4bin
C:UsersRahul>set JAVA_HOME
JAVA_HOME=C:Program FilesJavajdk1.7.0_05
C:UsersRahul>set PATH
Path=C:Program Files (x86)InteliCLS Client;C:Program FilesInteliCLS Clien
t;C:Program Files (x86)NVIDIA CorporationPhysXCommon;C:Program Files (x86)
PC Connectivity Solution;C:Program FilesCommon FilesMicrosoft SharedWindow
s Live;C:Program Files (x86)Common FilesMicrosoft SharedWindows Live;C:Wind
owssystem32;C:Windows;C:WindowsSystem32Wbem;C:WindowsSystem32WindowsPowe
rShellv1.0;C:Program Files (x86)Windows LiveShared;C:Program Files (x86)C
ommon FilesRoxio SharedOEMDLLShared;C:Program Files (x86)Common FilesRoxi
o SharedOEMDLLShared;C:Program Files (x86)Common FilesRoxio SharedOEM12.
0DLLShared;C:Program Files (x86)RoxioOEMAudioCore;C:Program Files (x86)
QuickTimeQTSystem;C:Program Files (x86)Androidandroid-sdktools;C:UsersR
ahulDownloadsapache-ant-1.8.4bin;c:Program Files (x86)Microsoft SQL Server
90Toolsbinn;C:Microsoft SQL Server JDBC Driver 3.0sqljdbc_3.0enuauthx86
;C:Program FilesJavajdk1.7.0_05bin;C:Program FilesIntelWiFibin;C:Pro
gram FilesCommon FilesIntelWirelessCommon;C:UsersRahulDownloadsapache-an
t-1.8.4binbin;C:Program Files (x86)IntelOpenCL SDK2.0binx86;C:Program F
iles (x86)IntelOpenCL SDK2.0binx64;C:Program Files (x86)IntelOpenCL SDK
2.0binx86;C:Program Files (x86)IntelOpenCL SDK2.0binx64;G:adt-bundle-wi
ndows-x86_64sdkplatform-tools;G:adt-bundle-windows-x86_64sdktools;C:Progra
m Files (x86)Subversionbin;C:UsersRahulDownloadsapache-ant-1.8.4bin;C:Pr
ogram FilesJavajdk1.7.0_05bin;C:Program Files (x86)OpenVPNbin;C:Program F
ilesIntelWiFibin;C:Program FilesCommon FilesIntelWirelessCommon;C:grad
le-1.6-allgradle-1.6bin;C:Program Files (x86)Googlegoogle_appengine;C:Use
rsRahulDownloadsapache-ant-1.8.4bin;C:Program FilesJavajdk1.7.0_05bin
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
C:UsersRahul>ant
ANT_HOME is set incorrectly or ant could not be located. Please set ANT_HOME.
C:UsersRahul>
ANT_HOME
设置不正确,因为ANT_HOME
指的是 Ant 安装目录的路径,该目录是 bin 的父目录。并且您设置的路径到 bin 是不正确的。
执行以下操作
ANT_HOME = C:UsersRahulDownloadsapache-ant-1.8.4
Ant Home 应该是
ANT_HOME = C:\Users\Rahul\Downloads\apache-ant-1.8.4
同样在环境变量中编辑路径系统变量并向其添加以下路径
;C:\Users\Rahul\Downloads\apache-ant-1.8.4\bin