且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在OSX中永久设置PATH环境变量

更新时间:2022-10-31 08:18:46

您必须将其添加到/etc/paths.

参考(适用于我):How to permanently set $PATH on Linux/Unix? but I had an error message saying no such file and directory, so I thought I could try ~/.bash_profile instead of ~/.profile but it did not work.

Second, I found this solution How to set the $PATH as used by applications in os x , which advices to make changes in

~/.MacOSX/environment.plist

but again I had no such file and directory error.

I need a way to set these variables such that it won't require to set them again and again each time I open a new terminal session.

You have to add it to /etc/paths.

Reference (which works for me) : Here