I just got a new computer which didn't have java or android sdk installed, I added both today, but the first time I made a mistake and downloaded java 10
and set that as the JAVA_HOME
but since then I downloaded java jdk 1.8
and made that the JAVA_HOME
but I'm still getting an error:
I'm doing - ionic cordova run android --device
with the error report saying:
ANDROID_HOME=C:\Users\Simon\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_172\bin
studio
ERROR: JAVA_HOME is set to an invalid directory: C:\Program Files\Java\jdk1.8.0_172\bin
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
(node:56548) UnhandledPromiseRejectionWarning: Error: cmd: Command failed with exit code 1
So it's saying I don't have the correct directory, but I'm pretty sure I do:
and here is my environment variables
:
However... when I do java -version
it returns:
java version "10.0.1" 2018-04-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.1+10)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode)
Not sure if that's normal...
What should I do? I think all the info should be correct.. Any ideas? Thanks!