When I run react-native run-android I get the error ERROR: JAVA_HOME is set to an invalid directory: /usr/libexec/java_home.
I add the Java home path to my bash profile like this:
export JAVA_HOME=$(/usr/libexec/java_home).
When I paste this and hit enter in the terminal:
/usr/libexec/java_home,
I get this:
/Library/Java/JavaVirtualMachines/jdk-12.0.1.jdk/Contents/Home.
But when I run react-native run-android, I still get the error.
It's driving me absolutely mad and I don't know how to fix it.
Any ideas hugely appreciated.
Set the value you get.
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-12.0.1.jdk/Contents/Home
export CLASSPATH=.:$JAVA_HOME/lib/tools.jar
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With