I'm new on Mac, so I installed Cordova (Node, Git, Grandle) but I can't execute it in my mobile phone, I mean I can't do "sudo Cordova run android" because it can't find "JAVA_HOME". When I installed I put this variable before... (It is a headache π€)
I tried to open the bash_profile but I didn't find it and if I open in terminal it always open a new file.
If I do echo $JAVA_HOME, it is the result:
echo $JAVA_HOME
/usr/libexec/java_home
And this is my error:
sudo cordova run android --target=ZY223T38PM
(node:1369) UnhandledPromiseRejectionWarning: CordovaError: Failed to find 'JAVA_HOME' environment variable. Try setting setting it manually. at /Users/tonitorres/Dropbox/HardwareHome/hardwareHome/platforms/android/cordova/lib/check_reqs.js:185:35 at _rejected (/Users/tonitorres/Dropbox/HardwareHome/hardwareHome/platforms/android/cordova/node_modules/q/q.js:864:24) at /Users/tonitorres/Dropbox/HardwareHome/hardwareHome/platforms/android/cordova/node_modules/q/q.js:890:30 at Promise.when (/Users/tonitorres/Dropbox/HardwareHome/hardwareHome/platforms/android/cordova/node_modules/q/q.js:1142:31) at Promise.promise.promiseDispatch (/Users/tonitorres/Dropbox/HardwareHome/hardwareHome/platforms/android/cordova/node_modules/q/q.js:808:41) at /Users/tonitorres/Dropbox/HardwareHome/hardwareHome/platforms/android/cordova/node_modules/q/q.js:624:44 at runSingle (/Users/tonitorres/Dropbox/HardwareHome/hardwareHome/platforms/android/cordova/node_modules/q/q.js:137:13) at flush (/Users/tonitorres/Dropbox/HardwareHome/hardwareHome/platforms/android/cordova/node_modules/q/q.js:125:13) at _combinedTickCallback (internal/process/next_tick.js:131:7) at process._tickCallback (internal/process/next_tick.js:180:9) (node:1369) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:1369) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
java -version
in terminal? β Catharinagit
andcordova
tagged in this? β Hydrous