According to this mobilefirst tutorial, it mentioned:
You must have the JAVA_HOME environment variable set to your JDK directory.
For example:
Mac OSX: /Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home
I've added this 2 lines in .bash_profile:
export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
export PATH=$PATH:$JAVA_HOME/Contents/Commands
Is this correct?
Thanks.
If your default terminal is /bin/zsh (Z Shell) like in my case, then you should set these environment variable in ~/.zshenv file with following contents:
export JAVA_HOME="$(/usr/libexec/java_home)"
Similarly, any other terminal type not mentioned above, you should set environment variable in its respective terminal env file.
After saved the content into env file, restart terminal and call following commands:
echo $JAVA_HOME
It should display the full Java path.
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