5

Is $HOME/.MacOSX/environment.plist still recognized/used in OS X 10.9.2 for setting global environment variables?

Apple's official documentation does not say explicitly it's deprecated, AFACT:

https://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/BPRuntimeConfig/Articles/EnvironmentVars.html

Some discussion threads claims it is no longer supported since 10.8:

How to set system-wide environment variables on OS X Mavericks

https://stackoverflow.com/questions/603785/environment-variables-in-mac-os-x/4567308#4567308

What to believe?

My experiments seem to indicate that it is not supported in 10.9.2, but I'm not sure, as I'm not familiar with .plist files etc. I'm trying to set JAVA_HOME permanently and globally for applications started by double clicking /Applications/XXX.app.

I have

$ more $HOME/.MacOSX/environment.plist
{
        "JAVA_HOME" = "/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home";
}

which is edited by open $HOME/.MacOSX/environment.plist and following the GUI.

1

You can yourself ensure that this file isn't anymore used with a command as simple as ls.

Just end your actual session, and connect back. Open Terminal or xterm. Run the following command:

$ cd ~/.MacOSX
$ ls -luT environment.plist
$

The output of this command will display you when this file was last opened for reading. If it was opened by any process during your session start, you should see it thanks to the u option.

To learn more about the investigation possibilities of ls just run:

$ man ls

BTW, your environment.plist file doesn't use the right syntax. But this doesn't matter.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .