A dynamic $HOME/.zshrc
solution, if you're like me ie. Linux @ work; MBP/A @ home
if [[ $(uname) == "Darwin" ]]; then export OSX=1; fi
if [[ $(uname) == "Linux" ]]; then export LINUX=1; fi
if [[ -n $OSX ]]; then
export JAVA_HOME=$(/usr/libexec/java_home)
else
export JAVA_HOME=/usr/lib/jvm/default-java
fi