mac配置Scala環境變數

2021-07-30 18:43:25 字數 997 閱讀 9102

首先我進入桌面 

cd desktop/
然後通過mv 進行移動到 user/rivercode/soft下
mv scala-2.11.8 ../soft/scala
3.設定環境變數

在/etc/paths下新增你安裝的scala/bin 目錄

4.通過cat /etc/paths 檢視paths

cat /etc/paths

結果如下

/etc cat /etc/paths

/usr/local/bin

/usr/bin

/bin

/usr/sbin

/sbin

/users/rivercode/soft/scala/scala-2.11.8/bin

5.檢視結果

6.注意

看到有人說在 /etc/profile裡設定環境變數,我試了,但是不成功,不知道為啥,如果誰知道的話可以告訴我,我**設定的不對,謝謝了。

我的 /etc/profile 的內如如下

➜  ~ cat /etc/profile

# system-wide .profile for sh(1)

if [ -x /usr/libexec/path_helper ]; then

eval `/usr/libexec/path_helper -s`

fiif [ "$" != "no" ]; then

[ -r /etc/bashrc ] && . /etc/bashrc

fiscala_home="/users/rivercode/software/scala/scala-2.11.8"

export path=$path:$scala_home/bin

結果不行,不知道為啥,希望知道的告訴我為啥。

mac 環境變數 配置

shell txt 可見剛剛新增的路徑被新增到了環境變數的最前面。研究了一下mac系統的環境變數,載入順序為 etc profile etc paths bash profile bash login profile bashrc 當然 etc profile和 etc paths是系統級別的,系統...

Mac 環境變數配置

環境變數修改後,重啟生效!環境變數修改後,重啟生效!環境變數修改後,重啟生效!mac 一般使用bash作為預設shell mac系統的環境變數,載入順序為 etc profile etc paths bash profile bash login profile bashrc 當然 etc prof...

Mac配置環境變數

hui mac配置環境變數 全域性 公有 配置,不管是哪個使用者,登入時都會讀取該檔案。全域性 公有 配置,bash shell執行時,不管是何種方式,都會讀取此檔案。每個使用者都可使用該檔案輸入專用於自己使用的shell資訊,當使用者登入時,該檔案僅僅執行一次 那麼當mac機器上安裝了zsh後,我...