Set environment variables on Mac OS X Lion

后端 未结 16 1349
余生分开走
余生分开走 2020-11-22 11:01

When someone says \"edit your .plist file\" or \"your .profile\" or \".bash_profile\" etc, this just confuses me. I have no idea where these files are, how to create them if

16条回答
  •  野性不改
    2020-11-22 11:23

    It is recommended to check default terminal shell before setting any environment variables, via following commands:

    $ echo $SHELL
    /bin/zsh
    

    If your default terminal is /bin/zsh (Z Shell) like in my case (Personally prefer Z Shell), then you should set these environment variable in ~/.zshenv file with following contents (In this example, setting JAVA_HOME environment variable, but same applies to others):

    export JAVA_HOME="$(/usr/libexec/java_home)"
    

    Similarly, any other terminal type not mentioned above, you should set environment variable in its respective terminal env file.

提交回复
热议问题