title: How to set JAVA_HOME environment variable on macOS?
body: <p>According to this <a href="https://developer.ibm.com/mobilefirstplatform/install/#clui" rel="nofollow noreferrer">mobilefirst tutorial</a>, it mentioned:</p>
  
  <p>You must have the JAVA_HOME environment variable set to your JDK directory. </p>
  
  <p>For example:</p>
  
  <p>Mac OSX: <em>/Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home</em></p>
  
  <p>I've added this 2 lines in .bash_profile:</p>
  
  <pre><code>export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
  export PATH=$PATH:$JAVA_HOME/Contents/Commands
  </code></pre>
  
  <p>Is this correct?</p>
  
  <p>Thanks.</p>