title: ERROR: JAVA_HOME is set to an invalid directory: /usr/libexec/java_home (Mac OSX)
body: <p>When I run <code>react-native run-android</code> I get the error <code>ERROR: JAVA_HOME is set to an invalid directory: /usr/libexec/java_home</code>.</p>
  
  <p>I add the Java home path to my bash profile like this:</p>
  
  <p><code>export JAVA_HOME=$(/usr/libexec/java_home)</code>.</p>
  
  <p>When I paste this and hit enter in the terminal:</p>
  
  <p><code>/usr/libexec/java_home</code>,</p>
  
  <p>I get this:</p>
  
  <p><code>/Library/Java/JavaVirtualMachines/jdk-12.0.1.jdk/Contents/Home</code>.</p>
  
  <p>But when I run <code>react-native run-android</code>, I still get the error.</p>
  
  <p>It's driving me absolutely mad and I don't know how to fix it.</p>
  
  <p>Any ideas hugely appreciated.</p>