无法使用 eclipse 和 windows 8 为 phonegap 正确安装 ant [英] Cannot get ant installed properly for phonegap using eclipse and windows 8

查看:18
本文介绍了无法使用 eclipse 和 windows 8 为 phonegap 正确安装 ant的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试在 Windows 8 上的 Eclipse 中使用 Phonegap.我在 C:\Development\HelloWorld 创建了一个项目.在命令行中,当我输入:

Trying to use Phonegap in Eclipse on windows 8. I've created a project at C:\Development\HelloWorld. In the command line, when I type:

phonegap local build android

我收到以下错误:

An error occurred during creation of android sub-project. ERROR : executing command 'ant', make sure you have ant installed and added to your path.

我的路径:

C:\Program Files\nodejs\;C:\Development\adt-bundle\sdk\platform-tools;C:\Development\adt-bundle\sdk\tools;%JAVA_HOME%\bin;%ANT_HOME%\bin;

怎么了?我已将 Ant 下载到我的 Development 文件夹中,并且还下载了所有其他必要的下载.任何帮助将不胜感激.

Whats going wrong? I have downloaded Ant into my Development folder and all other necessary downloads are downloaded as well. Any help would be appreciated.

推荐答案

我一直在关注 Phonegap 的 Android 平台指南,但不断收到上述错误.指南上的指示有点混乱.我回去检查我安装了什么,发现一些配置错误.

I was following Phonegap's platform guide for Android and I kept getting the above error. The directions on the guide were a little confusing. I went back to check what I had installed and found some configuration errors.

在环境变量下,我创建了新的 ANDROID_HOME、ANT_HOME 和 JAVA_HOME 系统变量,并以各自的物理文件路径作为值.这部分可能有点矫枉过正,但我​​试图涵盖我的基础,到目前为止我没有发现任何重大问题.

Under Environment Variables, I created new ANDROID_HOME, ANT_HOME, and JAVA_HOME system variables with the respective physical file paths as the value. This part may be overkill, but I was trying to cover my bases and I have noticed no significant issues with it so far.

示例:

变量:ANDROID_HOME 值:C:\Development\adt-bundle\sdk

Variable: ANDROID_HOME Value: C:\Development\adt-bundle\sdk

变量:ANT_HOME 值:C:\Development\apache-ant-1.9.2

Variable: ANT_HOME Value: C:\Development\apache-ant-1.9.2

变量:JAVA_HOME 值:C:\Program Files\Java\jdk1.6.0_45

Variable: JAVA_HOME Value: C:\Program Files\Java\jdk1.6.0_45

接下来,我将以下值添加到环境变量中的 Path 系统变量中:

Next I added the following values to the Path system variable in Environment Variables:

%JAVA_HOME%\bin;%ANT_HOME%\bin;%ANDROID_HOME%\platform-tools;%ANDROID_HOME%\tools;

%JAVA_HOME%\bin;%ANT_HOME%\bin;%ANDROID_HOME%\platform-tools;%ANDROID_HOME%\tools;

在进行这些更改并继续按照指南进行操作后,一切正常.归结为没有将我的系统变量设置为正确的物理文件路径.

After making these changes and continuing to follow the guide, everything worked like it should. It boiled down to not having my system variables set to the correct physical file path.

这篇关于无法使用 eclipse 和 windows 8 为 phonegap 正确安装 ant的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆