Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set the $PATH as used by applications in os x

I'm using ant to build my project, and use the 'svnversion' executable to insert a version id into my sources for easy tracking of versions.

Running this ant file from the command line works, I've set my $PATH in .profile to include the path to svnversion and it works fine.

Now I try and run this same ant file from inside Eclipse and that does not work - the PATH in eclipse is set in another way than the PATH of the shell, I suspect this has to be set in a plist somewhere, but I don't know where.

like image 944
Simon Groenewolt Avatar asked Jan 20 '09 11:01

Simon Groenewolt


2 Answers

Correct -- it's in the plist file

~/.MacOSX/environment.plist

This file actually contains key-value pairs for any environment variables you want to set, for the whole login session. Unlike .profile/.cshrc etc, it's available to GUI programs. Unfortunately, you can't access other environment variables (e.g., you can't use $HOME) or use any other programmatic constructs here.

Update: note that this is no longer supported under OS X 10.8 Mountain Lion, alas.

like image 159
Andrew Jaffe Avatar answered Nov 15 '22 06:11

Andrew Jaffe


A quick search at developer.apple.com turned up Setting environment variables for user processes.

like image 45
Egil Avatar answered Nov 15 '22 07:11

Egil