Mac OS X Lion no longer recognizes environment.plist?

Viewed 31595

Just installed Lion today and my PATH env variable is no longer being set by ~/.MacOSX/environment.plist. Did something change? Can't seem to find any info on that or how to fix. Any ideas?

Here's the contents of the PLIST:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>PATH</key>
    <string>/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/X11/bin:/Users/mdi/bin</string>
</dict>
</plist>
11 Answers

Do it like brew and create a symlink in /usr/local/bin/. Works perfectly for me and is IMO a more unix-like solution where everything is a file.

The modern way to set environment variables for all processes launched by the current UI user is by having a launch agent.

Using an example from the AutoDesk documentation, create a file at ~/Library/LaunchAgents/environment.plist (can use any filename) with the following content:

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

<plist version="1.0">
<dict>
    <key>Label</key>
    <string>my.startup</string>
    <key>ProgramArguments</key>
    <array>
    <string>sh</string>
    <string>-c</string>
    <string>launchctl setenv RV_OS_PATH_OSX /volumes/zdisk;
launchctl setenv RV_OS_PATH_WINDOWS Z:;</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
</dict>
</plist>
Related