Friday 2 November 2012

Global / System wide environmental variables on Mac OSX

2.40pm. Today I was asked how to set environmental variables on Mac OSX, after a little research it would appear most solutions required the user to create a ~./MacOSX/environment.plist in their home directory. However this meant that every user on the box had to jump through this hoop.

To apply the environmental variable system wide I performed the following:
sudo vi /etc/launchd.conf
I then populated the /etc/launchd.conf file with my environmental variables, something like:
setenv    JAVA_HOME    /opt/java/bin/java
setenv    VIDEO_IN       /Videos/In
Reboot the Mac and you are all set.

No comments:

Post a Comment