我如何在Eclipse中开始使用PhoneGap?

时间:2023-01-25 09:00:16

Trying to create my first PhoneGap project in eclipse. I have followed the Getting Started tutorial but that only seems to help in a best case scenario. My guess is that if they make the tutorials vague enough people will pay them for adequate help.

试图在eclipse中创建我的第一个PhoneGap项目。我已经按照入门教程进行了操作,但这似乎只对最佳情况有所帮助。我的猜测是,如果他们让教程模糊不清,人们会向他们付出足够的帮助。

Following this tutorial: Getting Started with Android

遵循本教程:Android入门

When I run the create command I get the following error (see below). My guess that my environment is not ready. I have installed the Android SDK, I have the Java SDK installed and in my path. The only part that I am not clear on is the Apache Ant. I thought that was installed along with Eclipse?

当我运行create命令时,我收到以下错误(见下文)。我猜我的环境尚未准备好。我安装了Android SDK,我安装了Java SDK并在我的路径中。我不清楚的唯一部分是Apache Ant。我以为这是与Eclipse一起安装的?

Missing one of the following:
JDK: http://java.oracle.com
Android SDK: http://developer.android.com
Apache ant: http://ant.apache.org

What do I need to do to fix this problem and successfully create a PhoneGap project in Eclipse?

我需要做些什么来解决这个问题并在Eclipse中成功创建PhoneGap项目?

1 个解决方案

#1


21  

I'm assuming you're on Windows because I just finished resolving the same error.

我假设你在Windows上,因为我刚刚解决了同样的错误。

What I did:

我做了什么:

  • Install the latest JDK [1]
  • 安装最新的JDK [1]
  • Install Apache Ant binary [2]
  • 安装Apache Ant二进制文件[2]
  • Install Android SDK [3]
  • 安装Android SDK [3]

After all of those were installed I appended the below paths to my Path system variable which can be found at:

安装完所有这些后,我将以下路径添加到我的Path系统变量中,该变量可在以下位置找到:

Control Panel > System > Advanced System Settings > Advanced tab > Environment Variables button > System variables

控制面板>系统>高级系统设置>高级选项卡>环境变量按钮>系统变量

C:\Program Files\Java\jdk1.7.0_09\bin;C:\Users\Rob\Documents\apache-ant-1.8.4\bin;C:\Program Files (x86)\Android\android-sdk\tools

C:\ Program Files \ Java \ jdk1.7.0_09 \ bin; C:\ Users \ Rob \ Documents \ apache-ant-1.8.4 \ bin; C:\ Program Files(x86)\ Android \ android-sdk \ tools

Be aware that my username is in those paths so yours will be different. Don't forget the semi-colon between the existing path and what you will be adding.

请注意我的用户名在这些路径中,因此您的用户名将有所不同。不要忘记现有路径和要添加的内容之间的分号。

Depending on your usage of the above tools, it may be cleaner to add the path to the create.bat script.

根据您对上述工具的使用情况,将路径添加到create.bat脚本可能更简洁。

  1. http://www.oracle.com/technetwork/java/javase/downloads/index.html
  2. http://www.oracle.com/technetwork/java/javase/downloads/index.html
  3. http://ant.apache.org/bindownload.cgi
  4. http://ant.apache.org/bindownload.cgi
  5. http://developer.android.com/sdk/index.html
  6. http://developer.android.com/sdk/index.html

#1


21  

I'm assuming you're on Windows because I just finished resolving the same error.

我假设你在Windows上,因为我刚刚解决了同样的错误。

What I did:

我做了什么:

  • Install the latest JDK [1]
  • 安装最新的JDK [1]
  • Install Apache Ant binary [2]
  • 安装Apache Ant二进制文件[2]
  • Install Android SDK [3]
  • 安装Android SDK [3]

After all of those were installed I appended the below paths to my Path system variable which can be found at:

安装完所有这些后,我将以下路径添加到我的Path系统变量中,该变量可在以下位置找到:

Control Panel > System > Advanced System Settings > Advanced tab > Environment Variables button > System variables

控制面板>系统>高级系统设置>高级选项卡>环境变量按钮>系统变量

C:\Program Files\Java\jdk1.7.0_09\bin;C:\Users\Rob\Documents\apache-ant-1.8.4\bin;C:\Program Files (x86)\Android\android-sdk\tools

C:\ Program Files \ Java \ jdk1.7.0_09 \ bin; C:\ Users \ Rob \ Documents \ apache-ant-1.8.4 \ bin; C:\ Program Files(x86)\ Android \ android-sdk \ tools

Be aware that my username is in those paths so yours will be different. Don't forget the semi-colon between the existing path and what you will be adding.

请注意我的用户名在这些路径中,因此您的用户名将有所不同。不要忘记现有路径和要添加的内容之间的分号。

Depending on your usage of the above tools, it may be cleaner to add the path to the create.bat script.

根据您对上述工具的使用情况,将路径添加到create.bat脚本可能更简洁。

  1. http://www.oracle.com/technetwork/java/javase/downloads/index.html
  2. http://www.oracle.com/technetwork/java/javase/downloads/index.html
  3. http://ant.apache.org/bindownload.cgi
  4. http://ant.apache.org/bindownload.cgi
  5. http://developer.android.com/sdk/index.html
  6. http://developer.android.com/sdk/index.html