Home » Questions » Computers [ Ask a new question ]

PATH env variable on Mac OS X and/or Eclipse

PATH env variable on Mac OS X and/or Eclipse

When I print out the path in bash, it prints this:

Asked by: Guest | Views: 391
Total answers/comments: 5
Guest [Entry]

"Aha, I found this webpage which says

Note: Mac OS X does not include
/usr/local/bin in its default PATH.
Therefore, assuming you're using the
default bash shell, please type (or
include in /etc/profile) export
PATH=/usr/local/bin:$PATH before using
any of these tools.

Is this an appropriate/inappropriate thing to do? I get leery of editing system files unless I really know what I'm doing. /usr/local/bin is only writeable by root so I wouldn't be opening a security hole, would I?

Odd, I added the export path, and it has no effect on eclipse run from the Dock. Also I found this page about paths and my /etc/paths file has

/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/bin

and yet those paths don't show up in eclipse... is there an easy way to create/find a binary file that prints out $PATH, that I could run from the Dock, so I could debug this more easily? I don't know if Eclipse mucks around with the path."
Guest [Entry]

"Had the same problem. Here is my solution:

Edit the /etc/paths file to include the desired additional path.
For a OSX installation, run /Applications/eclipse/eclipse not /Applications/eclipse/Eclipse.app"
Guest [Entry]

"This tip above works for me:
1) add path to /etc/paths as root
2) start eclipse with $ECL_HOME/Eclipse.app/Contents/MacOS/eclipse instead of $ECL_HOME/Eclipse.app"
Guest [Entry]

Most likely, one of your bash login scripts (.bashrc or .bash_profile) is changing $PATH. If you start Eclipse from the terminal, does it get /usr/local/bin in its path?
Guest [Entry]

"Alternatively you might just add a symbolic link to your /usr/local directory pointing to your application.

E.g. do as root:

ln -s /Applications/PhantomJS/phantomjs-1.9.2-macosx/bin/phantomjs /usr/local/phantomjs

This helped me to run (mvn test) the external PhantomJS application from within a Maven project in Eclipse."