Setting environment variables in OS X?
stackoverflow.com/questions/135688/setting-environment-variables-in-os-x
?
4) Save your changes in VI and reboot your Mac. Or use the grep/xargs command show in the code comment above.
5) Prove that your variables are working by opening a Terminal window and typing export
and you should see your new variables. These will also be available in IntelliJ and other GUI apps you launch via Spotlight.