> ~/.zshrc $ source ~/.zshrc"> > ~/.zshrc $ source ~/.zshrc"> > ~/.zshrc $ source ~/.zshrc">
$ vim ~/.zshrc
添加 export PATH="/opt/anaconda3/bin:$PATH" // 替换为对应路径

或者使用"echo"命令
$ echo 'export PATH="/opt/anaconda3/bin:$PATH"' >> ~/.zshrc

$ source ~/.zshrc

添加 Java 环境变量(zsh)

echo 'export PATH="/opt/homebrew/opt/openjdk@17/bin:$PATH"' >> ~/.zshrc

# or

# (Maven 需要读取 JAVA_HOME)
echo 'export JAVA_HOME="/opt/homebrew/opt/openjdk@17"' >> ~/.zshrc

echo 'export PATH="$JAVA_HOME/bin:$PATH"' >> ~/.zshrc