1
votes

I'm trying to run phonegame on Windows 8 and I get the following error when I type phonegap run android. Any ideas how to solve it? I have everything ready, nodejs, cordova and etc.

C:\Users\almeidamarcell\my-app>phonegap run android [phonegap] detecting Android SDK environment... [phonegap] using the local environment [phonegap] adding the Android platform... [error] An error occured during creation of android sub-project.

C:\Users\almeidamarcell.cordova\lib\android\cordova\3.3.0\bin\node_modules\q\q. js:126 throw e; ^ Error: Failed to run 'java -version', make sure your java environment is set up including JDK and JRE. Your JAVA_HOME variable is undefined Error: Command failed: 'java' is not recognized as an internal or external comma nd,

operable program or batch file.

at C:\Users\almeidamarcell\.cordova\lib\android\cordova\3.3.0\bin\lib\check_

reqs.js:62:22 at ChildProcess.exithandler (child_process.js:641:7) at ChildProcess.EventEmitter.emit (events.js:98:17) at maybeClose (child_process.js:743:16) at Socket. (child_process.js:956:11) at Socket.EventEmitter.emit (events.js:95:17) at Pipe.close (net.js:465:12)

C:\Users\almeidamarcell\my-app>phonegap run android

1

1 Answers

2
votes

I think you don't have java installed in your computer.If it is installed, path is not set properly. Give the path of Ant too. You need to add Android SDk and prepare Android Targets via SDK manager before going through this.

I hope following reference might help you.

-JAVA_HOME (C:\Program Files\Java\jdk1.7.0_51)
-ANT_HOME (C:\Program Files\apache\apache-ant-1.9.3)
-ANDROID_HOME (C:\Program Files (x86)\Android\android-sdk\platform-tools)