在OSX设置PATH环境变量永久

在OSX设置PATH环境变量永久

本文介绍了在OSX设置PATH环境变量永久的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经阅读了如何为permenantly OSX上设置环境变量几个答案,

I have read several answers on how to set environmental variables on OSX as permenantly,

首先,我试图在Linux这一点,但我有一个错误信息说没有这样的文件和目录,所以我想我可以尝试〜/ .bash_profile中而不是〜/ .profile文件,但没有奏效。

First, I tried this, How to permanently set $PATH on Linux? 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.

第二,我发现这个解决方案How设置$ PATH 13759在OS X中,该通知:做出改变。

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打开一个新的终端会话时间的方式来设置这些变量,这样它将不要求重新设置并重新

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.

推荐答案

您必须将它添加到的/ etc /路径

参考(这为我的作品):Here

Reference (which works for me) : Here

这篇关于在OSX设置PATH环境变量永久的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 00:31