修改环境变量 mac windows ubuntu
2020-04-30 本文已影响0人
汉江岳
环境变量的概念
The PATH variable is a list of directories where each directory contains a UNIX executable file (or its alias) for a command/program.
When a command is entered in the terminal, it searches for an executable file with the same name as the entered command in the PATH variable. In the event that the required file is not found, the terminal will respond with an error message saying that the command was not found.
- Mac path
- for all user
/etc/paths # root
- user XXX only
# 追加 export 语句
/Users/XXX/.bash_profile # exprot ...
or
/Users/XXX/.bashrc # export
# for example
export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk-12.0.1.jdk/Contents/Home"
# source
source .bashrc
- Windows
- Ubuntu
同理