Every time I try to build my Android platform on ionic, I am greeted by an error indicating that my JAVA_HOME is invalid, while it points to the correct path, as shown below. I tried to remove and re-add the platform and re-add the paths to the environment variables, but nothing works. I have been trying to fix this error for several days. Please, help!
Entrance:
ionic build android
Conclusion:
[Error: Failed to run "java -version", make sure that you have a JDK installed. You can get it from: http://www.oracle.com/technetwork/java/javase/downloads. Your JAVA_HOME is invalid: C:\Program Files\Java\jdk1.7.0_75; ] ERROR building one of the platforms: Error: C:\myApp\platforms\android\cordova\b uild.bat: Command failed with exit code 2 You may not have the required environment or OS to build this project Error: C:\myApp\platforms\android\cordova\build.bat: Command failed with exit co de 2 at ChildProcess.whenDone (C:\Users\com\AppData\Roaming\npm\node_modules\cord ova\node_modules\cordova-lib\src\cordova\superspawn.js:131: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)
source share