MAC-开发环境安装配置
...大约 2 分钟
MAC-开发环境安装配置
JDK安装配置
jdk安装
参考链接:多版本jdk切换
# 1.搜索可用的jdk版本
brew search jdk
# 2.此处全局安装jdk17
brew install openjdk@17
// 提示信息
For the system Java wrappers to find this JDK, symlink it with
sudo ln -sfn /opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-17.jdk
openjdk@17 is keg-only, which means it was not symlinked into /opt/homebrew,
because this is an alternate version of another formula.
If you need to have openjdk@17 first in your PATH, run:
echo 'export PATH="/opt/homebrew/opt/openjdk@17/bin:$PATH"' >> ~/.zshrc
For compilers to find openjdk@17 you may need to set:
export CPPFLAGS="-I/opt/homebrew/opt/openjdk@17/include"
# 3.JDK环境变量配置
echo 'export PATH="/opt/homebrew/opt/openjdk@17/bin:$PATH"' >> ~/.zshrc
export CPPFLAGS="-I/opt/homebrew/opt/openjdk@17/include"
# 执行指令使配置生效
source ~/.zshrc
# 等待安装完成查看jdk版本的指令信息(查看jdk版本信息,以及javac指令是否可以正常运行)
java -version
javac
# jdk8版本切换
# 搜索jdk版本(检索最新版本)
brew search temurin
# 如果没有想要的版本则要升级一下,然后再执行search指令
brew tap homebrew/cask-versions
brew update
temurin temurin@11 temurin@17 temurin@19 temurin@20 temurin@21 temurin@8
# 安装指定版本
brew install temurin@8
安装完成可以在idea中指定JDK版本(注意检查此处只是安装,原有的环境配置还是JDK17)
Maven安装配置
maven安装
# 使用maven进行安装
brew install maven
// 如果提示无法下载,则根据提示更新下载软件,例如xcoode-select等
# 输入执行验证安装(此处最新版本:3.9.6)
mvn -version
# 输入mvn -version查看maven安装信息(brew自动配置maven路径)
Apache Maven 3.9.6 (bc0240f3c744dd6b6ec2920b3cd08dcc295161ae)
Maven home: /opt/homebrew/Cellar/maven/3.9.6/libexec
Java version: 21.0.3, vendor: Homebrew, runtime: /opt/homebrew/Cellar/openjdk/21.0.3/libexec/openjdk.jdk/Contents/Home
Default locale: zh_CN_#Hans, platform encoding: UTF-8
OS name: "mac os x", version: "14.4.1", arch: "aarch64", family: "mac"
# 进入maven安装目录
cd /opt/homebrew/Cellar/maven/3.9.6/libexec
# 查看conf文件夹的配置信息,修改settings配置文件(配置阿里云公共仓库)
<mirror>
<id>aliyunmaven</id>
<mirrorOf>*</mirrorOf>
<name>阿里云公共仓库</name>
<url>https://maven.aliyun.com/repository/public</url>
</mirror>
# idea中配置
settings=》maven:配置maven安装路径、配置对应settings文件
idea安装配置参考
参考文档:https://shimo.im/docs/1lq7rwv9xesOQj3e/read
代理设置:
- Manual proxy configuration
- 设置Host Name: localhost (端口号默认80)
- 设置 No proxy for: *.github.com,plugins.jetbrains.com
# 参考激活码
SFXUSA86FM-eyJsaWNlbnNlSWQiOiJTRlhVU0E4NkZNIiwibGljZW5zZWVOYW1lIjoi5pyd6Zm956eR5oqA5aSn5a24IiwibGljZW5zZWVUeXBlIjoiQ0xBU1NST09NIiwiYXNzaWduZWVOYW1lIjoiVGFvYmFv77ya5p6B5a6i5LiT5LqrICAtLS0g6LCo6Ziy55uX5Y2W77yBIiwiYXNzaWduZWVFbWFpbCI6IktyaXN0YW5fQmxvd2VAb3V0bG9vay5jb20iLCJsaWNlbnNlUmVzdHJpY3Rpb24iOiJGb3IgZWR1Y2F0aW9uYWwgdXNlIG9ubHkiLCJjaGVja0NvbmN1cnJlbnRVc2UiOmZhbHNlLCJwcm9kdWN0cyI6W3siY29kZSI6IkdPIiwicGFpZFVwVG8iOiIyMDI1LTAyLTE5IiwiZXh0ZW5kZWQiOmZhbHNlfSx7ImNvZGUiOiJSUzAiLCJwYWlkVXBUbyI6IjIwMjUtMDItMTkiLCJleHRlbmRlZCI6ZmFsc2V9LHsiY29kZSI6IkRNIiwicGFpZFVwVG8iOiIyMDI1LTAyLTE5IiwiZXh0ZW5kZWQiOmZhbHNlfSx7ImNvZGUiOiJDTCIsInBhaWRVcFRvIjoiMjAyNS0wMi0xOSIsImV4dGVuZGVkIjpmYWxzZX0seyJjb2RlIj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S5+ghc4FTWxXJB1cjJRh3X+gwJIHjOVW+5ZVqXTG2s2Jwi2daDt6XYeigxgL2SlQpeL5kvXNCcuSJurJVcRZFYUkzVv85XfDauqGxYqaehPcK2TzmcXOUWPfxQxLJd2TrqSiO+mseqqkNTb3ZDiYS/ZqdQoGYIUwJqXo+EDgqlmuWUhkWwCkyo4rtTZeAj+nP00v3n8JmXtO30Fip+lxpfsVR3tO1hk4Vi2kmVjXyRkW2G7D7WAVt+91ahFoSeRWlKyb4KcvGvwUaa43fWLem2hyI4di2pZdr3fcYJ3xvL5ejL3m14bKsfoOv
githubDesktop
连接提示:代理错误相关,需检查代理配置,例如:git clone github上的项目时出现报错“Proxy CONNECT aborted”解决方法
# 一般配置
git config --global http.proxy "127.0.0.1:1080"
git config --global https.proxy "127.0.0.1:1080"
# 实际配置:按照代理协议和端口设置代理,比如代理协议是socks5,端口是10808(参考v2ray socks:127.0.0.1:1081)
git config --global http.proxy "socks:127.0.0.1:10808"
git config --global https.proxy "socks:127.0.0.1:10808"
# 取消配置(如果代理一直提示错误则取消git的代理配置)
git config --global --unset http.proxy
git config --global --unset https.proxy
Powered by Waline v3.1.3