2
votes

I have the next problem:

When I run, the fist time, cordova platform add android originate the follow error

Error: ERROR : executing command 'ant', make sure you have ant installed and added to your path.

I have ant installed and added in my path

The second time that I run cordova platform add android, it says:

Error: Failed to run 'java -version', make sure your java environment is set up
including JDK and JRE.
Your JAVA_HOME variable is C:\Program Files\Java\jdk1.7.0_67
Error: Command failed: Access denied.

I have my %JAVA_HOME% added

I am using Windows 8.

Any suggestions??


More information...

`C:\temp\siete>cordova platform add android
Creating android project...

C:\Users\user\.cordova\lib\android\cordova\3.5.0\bin\node_modules\q\q.js:126
                    throw e;
                          ^
Error: ERROR : executing command 'ant', make sure you have ant installed and added to your path.
    at C:\Users\user\.cordova\lib\android\cordova\3.5.0\bin\lib\check_reqs.js:47:27
    at ChildProcess.exithandler (child_process.js:652:7)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:756:16)
    at Process.ChildProcess._handle.onexit (child_process.js:823:5)
Error: C:\Users\user\.cordova\lib\android\cordova\3.5.0\bin\create.bat: Command failed with exit code 8
    at ChildProcess.whenDone (C:\Users\user\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:135:23)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:756:16)
    at Process.ChildProcess._handle.onexit (child_process.js:823:5)`
`C:\temp\siete>cordova platform add android
Creating android project...

C:\Users\user\.cordova\lib\android\cordova\3.5.0\bin\node_modules\q\q.js:126
                    throw e;
                          ^
Error: Failed to run 'java -version', make sure your java environment is set upincluding JDK and JRE.
Your JAVA_HOME variable is C:\Program Files\Java\jdk1.7.0_67
Error: Command failed: Acceso denegado.

    at C:\Users\user\.cordova\lib\android\cordova\3.5.0\bin\lib\check_reqs.js:62:22
    at ChildProcess.exithandler (child_process.js:652:7)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:756:16)
    at Process.ChildProcess._handle.onexit (child_process.js:823:5)
Error: C:\Users\user\.cordova\lib\android\cordova\3.5.0\bin\create.bat: Command failed with exit code 8
    at ChildProcess.whenDone (C:\Users\user\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:135:23)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:756:16)
    at Process.ChildProcess._handle.onexit (child_process.js:823:5)`
2
try to run the commands from Administrator? what does Acceso denegado stand for? Have you installed ANT, Have U set environment variables such as ANT_HOME, ANDROID_HOME, JAVA_HOME, ANDROID_SDK?frank
"Acceso denegado"="Access denied" I tried run from Administrator... I have my environment variables setted... and changed, and re-setted...DevMov
There should be a folder .cordova in "C:\Users\user\" directory. Delete the .cordova folder. Then delete the project directory, Install the cordova again and run all the cordova commands again.frank
Either... :( I'm thinking to restore all the system... And reinstall all againDevMov
first you can try my suggestion, if it does not work then you can reinstall all again.frank

2 Answers

0
votes

Maybe you need JDK 1.6 Java 32 bits. Do you speak spanish? - Take a look at this link:

http://www.phonegapspain.com/tutorial/como-instalar-phonegap-en-windows-7-paso-a-paso/

Gretings!

0
votes

You need to add %JAVA_HOME%\bin to the PATH variable.

The command shell can only see what's in the %PATH% directory.