- Terminal apps in OS X (Terminal, iTerm, etc.) process terminals as login shells, so these variables should be set in the
~/.bash_profile
and not the~/.bashrc
file.
- Create a
~/Library/LaunchAgents/environment.variables.plist
file to have launchd run a script at login that will set environment variables - Create a
/usr/local/bin/set-environment-variables.sh
script (or wherever configured in the*.plist
file) and "export" the environment variables here (bash syntax like "export JAVA_HOME ...
" doesn't work here) - Register the *.plist file with launchd