How to Set JAVA_HOME in MacOSX

$ vim .bash_profile

export JAVA_HOME=$(/usr/libexec/java_home)

$ source .bash_profile

$ echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home

https://www.mkyong.com/java/how-to-set-java_home-environment-variable-on-mac-os-x/

Advertisements