Reputation: 282
I am trying to get set up on a basic Hello World phonegap android application. I have installed and correctly configured the paths for ant, the java jdk, and the android sdk. However, when I attempt to run
create C:\Users\Shoes\Documents\Dev\Test com.codebundle.test Test
and cordova gave me the following error
Missing one of the following:
JDK: http://java.oracle.com
Android SDK: http://developer.android.com
Apache ant: http://ant.apache.org
I have tested that all the paths are setup correctly by trying
ant
adb
java
All worked fine, Please help
Upvotes: 14
Views: 16380
Reputation: 11
Setup PhoneGap project in six easy steps.
http://wezeste.blogspot.in/201...
Download latest phonegap release from -> http://phonegap.com/install/
unzip and go to android/bin directory of downloaded phonegap zip
SET DIFFERENT PATHS:(you can do this in environment also)
java: set path=%PATH%;C:\Program Files (x86)\Java\jdk1.7.0_21\bin
ant: set path=%PATH%;C:\apache-ant-1.9.4\bin
JAVA_HOME: set JAVA_HOME=C:\Program Files (x86)\Java\jdk1.7.0_21\bin
create D:\AndroidProjects com.project.example hello
Import the android project created in eclipse
Download and add cordova-2.2.0.jar in lib of your project.
Run your first test application
thanks
Upvotes: 1
Reputation: 792
To add the paths to the PATH variable isn't enough. You need to add JAVA_HOME explicit with the path to the bin folder of the JDK, for example:
JAVA_HOME -> C:\Program Files\Java\bin
Phonegap/Cordova is looking for the JAVA_HOME variable in your settings.
Upvotes: 14
Reputation: 41
I edited my system path variable and it looked like this at the end, I added lots but seems i had to coz it worked out only then
D:\Python27\Lib\site-packages\PyQt4;%CommonProgramFiles%\Microsoft Shared\Windows Live;c:\bin;D:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;D:\Program Files (x86)\PC Connectivity Solution\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;d:\wamp\bin\php\php5.2.6\;d:\cygwin\bin;D:\Program Files (x86)\Android\android-sdk\platform-tools;D:\Program Files (x86)\Android\android-sdk\tools;D:\wamp\bin\mysql\mysql5.0.51b\bin;D:\Program Files\Java\jdk1.7.0_01;D:\Program Files\Java\jdk1.7.0_01\bin;D:\Program Files\Java\jdk1.7.0_01\lib;D:\SDK\apache-ant-1.8.4;D:\SDK\apache-ant-1.8.4\bin;D:\SDK\apache-ant-1.8.4\lib
After editing your path, you should open a new command prompt window( in windows) before you run the test "java" "ant" "adb" or "javac" commands
Upvotes: 0
Reputation: 12664
set following two environment variables
C:\>set ANT_HOME="C:\apache-ant-1.8.4\"
C:\>set JAVA_HOME="C:\Program Files\Java\jdk1.7.0_04\"
Upvotes: 5
Reputation: 1
The problem was that create cannot find javac.exe
, include bin directory in the Path as well: C:\Program Files\Java\jdk1.7.0_11\bin
(in my case).
Upvotes: 0
Reputation: 1340
I have done all correct, but still get this message:
Missing one of the following:
JDK: http://java.oracle.com
Android SDK: http://developer.android.com
...
The solution for me was to add all to my user variable PATH not to the System variable PATH
Upvotes: 0
Reputation: 311
set the path of javac into your PATH variable, this works for me fine, I had the same problems. I added these three folders to the PATH variable:
C:\Program Files\Java\jdk1.7.0_05;
C:\Program Files\Java\jdk1.7.0_05\bin;
C:\Program Files\Java\jdk1.7.0_05\lib
When you on the cmd in Windows, you must be able to run these commands from anywhere:
javac
java
ant
When you can do this on the cmd wihtout errors, then cordova will run.
Upvotes: 2
Reputation: 23273
If you type "android" what happens? You need to make sure that the $ANDROID_HOME/tools and $ANDROID_HOME/platform-tools are both in your $PATH.
Worked with a friend last night and his problem was the JRE was in his path and not the JDK. So when he typed javac it could not be found. If you have the same issue you'll need to update your PATH to point to the location of the JDK.
Upvotes: 15