Mac Env
🍎

Mac Env

Tag
env
Last Edited Time
Dec 20, 2021 08:57 PM
Created
Jul 26, 2020 10:56 PM

Environment Binding

I am using zsh (Z shell), edit (vim) .zshrc in the / .
export PATH="$PATH:[PATH_TO_FLUTTER_GIT_DIRECTORY]/flutter/bin"
 

Python

vim .zshrc
# zshrc
export PATH="$PATH:/usr/local/bin/python3"
alias python="/usr/local/bin/python3"
# reboot config
source .zshrc
pip3 install --trusted-host pypi.org --trusted-host files.pythonhosted.org <> -vvv
 

这也可以

vim .bash_profile
i
export PATH=/Applications/phantomjs-2.1.1-macosx/bin:$PATH
esc
:wq
source .bash_profile
 
 
Hidden File
CMD+SHIFT+.
 
 
 

JAVA

/usr/libexec/java_home -V

# 获得位置
Matching Java Virtual Machines (3):
11.0.9 (x86_64) "Oracle Corporation" - "Java SE 11.0.9" /Library/Java/JavaVirtualMachines/jdk-11.0.9.jdk/Contents/Home
1.8.261.12 (x86_64) "Oracle Corporation" - "Java" /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
1.8.0_261 (x86_64) "Oracle Corporation" - "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_261.jdk/Contents/Home
 
 
zshc
cd ~/the/script/folder

chmod +x ./startup.sh
动态切换java
export JAVA_8_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_261.jdk/Contents/Home
export JAVA_11_HOME=/Library/Java/JavaVirtualMachines/jdk-11.0.9.jdk/Contents/Home
# 设置默认的 jdk 版本
export JAVA_HOME=$JAVA_8_HOME
# 动态切换版本的快捷命令
alias jdk8="export JAVA_HOME=$JAVA_8_HOME"
alias jdk11="export JAVA_HOME=$JAVA_11_HOME"
 

Loading Comments...