0
votes

when adding android platform to my cordova project i am getting this error

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_45\bin Error: Command failed: 'java' is not recognized as an internal or external command, operable program or batch file.

while i have set JAVA and JAVA_HOME variable in systemVariable. JAVA C:\Program Files\Java\jdk1.7.0_45\bin JAVA_HOME C:\Program Files\Java\jdk1.7.0_45 and in Path i have set this “;%JAVA_HOME%\bin”;%ANT_HOME%\bin;;%ANDROID_HOME%\platform-tools;%ANDROID_HOME%\tools;%JAVA%\bin;

1

1 Answers

1
votes

You only have to set JAVA_HOME environment variable Not JAVA.. And in 'PATH' add %JAVA_HOME%\bin ..

Then test java -version command in cmd first if its working then try to run cordova build command.

see this doc for more detail..