one simple way to add system variables to OSx is to include them in .zshrc file from your home ~
vim ~/.zshrc
and in there the new variable and also include it into $PATH
eg: with JAVA_HOME
export JAVA_HOME="/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home" export PATH="$JAVA_HOME:$PATH"