What is the proper way to modify environment variables like PATH in OS X?
I\'ve looked on Google a little bit and found three different files to edit:
Sometimes all of the previous answers simply don't work. If you want to have access to a system variable (like M2_HOME
) in Eclipse or in IntelliJ IDEA the only thing that works for me in this case is:
First (step 1) edit /etc/launchd.conf
to contain a line like this: "setenv VAR value" and then (step 2) reboot.
Simply modifying .bash_profile won't work because in OS X the applications are not started as in other Unix'es; they don't inherit the parent's shell variables. All the other modifications won't work for a reason that is unknown to me. Maybe someone else can clarify about this.