Now Mac OS X is the only major operating system without an easy way to modify environmental variables. Sure, you can edit your `.profile` or `.bashrc` or `.zhsrc`, but those settings do not carry over to your GUI applications, like the IDEs I am used to.
Applications are spawned by launchd, which is why changing shell environments doesn't get propagated to GUI apps. Use:
launchctl setenv MYVAR myval
to change the launchd environment and those of the launched apps. These changes are lost after a reboot, unless you configure launchd via a plist file with these values. And there's a graphical plist editor for those that really like guis for these things.
That said, OS X is fairly hostile to the use of environment variables as required settings for GUI apps. Personally, I can't really blame them...
Which is weird because it used to. But ~/.MacOSX/environment.plist (easily edited in the plist editor) got deprecated and isn't used any more.
Edit: Don't know if you know this, but you can use "launchctl setenv key value" to set environment variables that get used by GUI programs. Unfortunately there are 2 huge caveats: 1) it's not persistent so you need to make something that load them at boot time, and 2) if you load them too late, they won't be part of the Dock or Finder process and you'll need to restart those processes to get your custom env vars in there. When you click something from the Dock, it inherits the environment from the Dock, so it's important to get your vars into the Dock itself.
I've now grown used to running a script manually at boot time and then doing "killall Dock" so that when I launch Emacs or XCode I get the right PATH. If someone has a smoother solution, I'd love to hear it.