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:
It's quite simple. Edit file .profile
(vi, nano, Sublime Text or other text editor) file. You can found it at the ~/
directory (user directory) and set like this:
export MY_VAR=[your value here]
Example with Java home:
export JAVA_HOME=/Library/Java/JavaVirtualMachines/current
Save it and return to the terminal.
You can reload it with:
source .profile
Or close and open your terminal window.