I\'m a Linux user that just recently got a mac. I\'m trying to set up my IDE and found out that Macs don\'t use .bashrc / .bash_profile / etc. for GUI apps. So, if you have
Add the following line to /etc/launchd.conf
(create if it doesn't exist)
setenv MY_VARIABLE My\ value\ with\ spaces
Note that this will only have an effect after rebooting.
To use the new value without having to reboot, additionally run the command in the terminal
launchctl setenv MY_VARIABLE My\ value\ with\ spaces
as patrikha suggested.
Note that this will only have an effect for applications started after running the command. Manipulating /etc/launchd.conf
is still necessary to keep the change after rebooting.