简体   繁体   English

apache ant安装不正确

[英]apache ant not installing properly

I did download the apache-ant-1.8.4 and unzip the folder then placed into c drive after that I checked the apache-ant installed or not with command " ant -version " then command prompt gave me error like 我确实下载了apache-ant-1.8.4并解压缩了文件夹,然后将其放入c驱动器中,之后我用命令“ ant -version ”检查了是否安装了apache-ant,然后命令提示符给了我类似的错误

'ant' is not recognized as an internal or external command,operable program or batch file. 无法将“ ant”识别为内部或外部命令,可操作程序或批处理文件。

I already set environment variable of Java and ant. 我已经设置了Java和ant的环境变量。 please see my environment variable shown below.. 请参阅下面显示的我的环境变量。

ANT_HOME -> C:\\apache-ant\\apache-ant-1.8.4\\bin ANT_HOME-> C:\\ apache-ant \\ apache-ant-1.8.4 \\ bin
JAVA_HOME -> C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\Program Files\\Java\\jdk1.6.0_37\\bin JAVA_HOME-> C:\\ WINDOWS \\ system32; C:\\ WINDOWS; C:\\ Program Files \\ Java \\ jdk1.6.0_37 \\ bin

I am using windows xp. 我正在使用Windows XP。 please tell me where I am doing wrong. 请告诉我我做错了什么。 I trying lot but not achieve my goal. 我尝试了很多但没有实现我的目标。 please somebody help me to solve this bug. 请有人帮我解决这个错误。 Thanks in advance. 提前致谢。

Try This : - set your environment variable on System properties 试试看:-在系统属性上设置环境变量
a: variable : ANDROID_HOME a:变量:ANDROID_HOME
value : your Path\\phonegap\\sdk 值:您的Path \\ phonegap \\ sdk
b: variable : ANT_HOME b:变量:ANT_HOME
value : your Ant HOme\\java\\apache-ant-1.9.2 值:您的Ant HOme \\ java \\ apache-ant-1.9.2

I hope this help for your problem solve 希望对您的问题有所帮助

Ant is not installed , it is unzipped into any folder you wish. 安装 Ant,它已解压缩到所需的任何文件夹中。

If you open a command prompt and try to run any executable, it is your operating system (Windows in this case) that searches for it. 如果您打开命令提示符并尝试运行任何可执行文件,则将由您的操作系统(在本例中为Windows)进行搜索。 Where does it search? 它在哪里搜索? In the current directory (Windows does that, Linux fortunately not), and in all directories that are part of the PATH environment variable. 在当前目录中(Windows会这样做,幸运的是Linux不在),并且在PATH环境变量中的所有目录中。

What I always do (and I always recommend): 我一直做的事情(我总是建议):

1) Add an environment variable ANT_HOME pointing to the directory, where you placed Ant. 1)添加一个环境变量ANT_HOME,指向指向放置Ant的目录。 For example ANT_HOME = C:\\apache-ant\\apache-ant-1.8.4 . 例如ANT_HOME = C:\\apache-ant\\apache-ant-1.8.4 Have a look: this variable does not point to the bin directory. 看一下:此变量指向bin目录。

2) Add the following to your PATH variable: 2)将以下内容添加到您的PATH变量中:

PATH = ...;%ANT_HOME%\bin

This is the same way, I also do with Java, Maven, JBoss, and whatever tool I use. 这是相同的方式,我也使用Java,Maven,JBoss以及我使用的任何工具。 If you ever change your installation (maybe also to a new directory), you must only change the appropriate home variable. 如果您曾经更改过安装(可能也更改到新目录),则只能更改相应的变量。 The path will be adjusted automagically. 路径将自动调整。


EDIT (I just saw your JAVA_HOME variable) 编辑(我刚刚看到了您的JAVA_HOME变量)

Change your JAVA_HOME variable to contain C:\\Program Files\\Java\\jdk1.6.0_37 . 将您的JAVA_HOME变量更改为包含C:\\Program Files\\Java\\jdk1.6.0_37 Then add this also to the PATH variable: 然后将其也添加到PATH变量中:

PATH = ...;%JAVA_HOME%\bin

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM