How to change PATH environment variable to OS X 10.8 Mountain Lion that will be visible to GUI applications? I tried all methods I heard of for setting environment variables on OS X 10.8 but none of them seems to work.

To test, run a bash script from inside a gui application like Eclipse or IntelliJ IDEA.

#!/bin/bash
set|grep PATH


Things I tested and that are not working even after reboot:


/etc/paths and /etc/paths.d/something
/etc/launchd.conf
~/.bash_profile
~/.MacOSX/environment.plist (binary plist made as recommended)
running launchctl setenv PATH $PATH from the command line, this was supposed to update the PATH for GUI apps, at least for current session. Guess what, no change.


It seems that PATH is always PATH=/usr/bin:/bin:/usr/sbin:/sbin for GUI apps.
With Mountain Lion /etc/launchd.conf is where you should set the GUI applications Path. Remember it's not a script file; it only supports launchctl commands so you should write something like:

setenv PATH /new/path:/usr/bin:/bin:/usr/sbin:/sbin


Note also that it doesn't support shell environment variable substitutions (like $PATH) so you'll have to set every path that you want to include. It's a good idea to keep the original paths that you've mentioned (/usr/bin:/bin:/usr/sbin:/sbin).

You'll have to reboot after changing (or creating) the file for the changes to take effect.