Mac - OSX - Admin system - Environment variables
< Mac - OSX - Admin system
< Mac - OSX
< Mac
< Technology
< politicus
Get flash to fully experience Pearltrees
Posted on April 12th, 2009 Nattl
There are essentially two problems to solve when dealing with environment variables in OS X.
Dot files aren't, by default, visible in the finder, so type cd; open .MacOSX in a terminal. If the environment.plist file is there you can open it in the Property List editor with a doubleClick.
When you run a command from a UNIX or UNIX-like shell, the shell looks for the executable file using the directories listed in your PATH variable as a map.
Otherwise, you can just go to /etc/paths.d and put the file there directly.
Mac OS X is a descendant of both unix and previous Mac OS traditions, and has inherited different - and sometimes conflicting - ways of looking at things from both sides. One of these is the way the locations of files are described, generally referred to as file paths (i.e. the path to take to get to the file).
If you are new to Mac OS X, you may need to know how to edit your PATH. The good news is that this is an easy task on Mac OS X. The recommended way is by editing your .bash_profile file.
Setting the PATH on Windows
MacOS X native applications do not see unix environment variables defined in ~/.cshrc or any other of the standard unix configuration files.
They're incredibly convenient, particularly if you maintain packages that need to append to such variables and you want to be able to cleanly uninstall such additions.
Having just spent way too long (couple hours) figuring out how to set environment variables on Mac OS X 10.5 in such a way that they were accessible from a bundled Java application (specifically, M2_HOME in IntelliJ so that the Maven integration would work 100%), I'm writing this up so that 1) I don't have to remember it later, and 2) to possibly save other folks the hassle.
As with any Unix operating system, Macintosh OS X recognizes the use of environment variables.