mac add environment variables

https://blog.csdn.net/handsomefuhs/article/details/79687381

 

 Disclaimer: This article is a blogger original article, shall not be reproduced without the bloggers allowed. https://blog.csdn.net/HandsomeFuHS/article/details/79687381 
Fellow students Hello everybody! Introduce myself: I was doing before Andrews, and later switch to machine learning, leisure time during a self-learning machine for two months, and now has just recruited a new company, the main responsibility is big data and machine learning. But I did not mind the contact data is too large, in which half of the new company, the encounter various problems, the company has too busy to record, so now taking the time to record, slowly progressive, will also continue publication of relevant blog.

Today to introduce it to add environment variables in the mac environment! 
My mac configuration:

mac Configuration

  1. Mac system environment variables, the load order is: 
    a / etc / Profile.  
    B / etc / Paths.  
    C ~ / .bash_profile.  
    D ~ / .bash_login.  
    E ~ / .profile.  
    F ~ / .bashrc. 
    Wherein a and b is the system level, the system will start loading the rest of the user is connected to something else. c, d, e read from front to back in order, if c file exists, the file will be the next few ignored read, and so on. ~ / .bashrc no such rule, it is loaded bash shell when opened. It is recommended to add environment variables c, the following is added to the environment variable c to the presentation.
  2. Open Terminal, enter vi ./.bash_profile, press Enter to open ./.bash_profile file: Enter vi ./.bash_profileAttention
    Enter: 
  3. ./.Bash_profile has now opened the file, but also in view mode can not be edited. Input "i", into the insert mode
  4. Then you can add environment variables, such as:

    export SCALA_HOME=/Users/fushuai/Documents/scala-2.12.4
    export PATH=$PATH:$SCALA_HOME/bin
    • 1
    • 2
  5. Editing is complete, click on the "esc key to exit insert mode" and then enter ":! Wq", Enter, save success. 
    Write pictures described here
  6. Enter the "source ./.bash_profile", so that the environment variables to take effect.
  7. Enter "echo $ PATH", view the environment variables, found that adding success. 
  8. Re-open the terminal, the environment variable will take effect.

Today was one, thank you!

Guess you like

Origin www.cnblogs.com/sundaysgarden/p/10968764.html