Emacs doesn't use macOS's /etc/launchd.conf env variables. I have the following there:
function addToPATH {
case ":$PATH:" in
*":$1:"*) :;; # already there
*) PATH="$1:$PATH";; # or PATH="$PATH:$1"
esac
}
export JAVA_HOME8=`/usr/libexec/java_home --version 1.8`
export JAVA_HOME9=`/usr/libexec/java_home --version 9`
export JAVA_HOME=$JAVA_HOME8
addToPATH $JAVA_HOME
But when I use getenv in Emacs to see my JAVA_HOME, it's unset. Setting it using setenv in my init file solves my issue, but this is an ugly workaround.
PS: I also set this variable in .zshenv, which I source in .bashrc, which I source in .bash_profile. So I am really confused that Emacs is not picking this up.
setenv-internaland set the variableprocess-environment.