Mac安装开发环境

参考博客

一、Mac安装HomeBrew

先安装HomeBrew,后续安装其他环境,直接通过Homebrew命令安装,省时省力参考此文

Haskell 复制代码
# 安装命令
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

# 查看是否安装成功
brew --version 

二、HomeBrew安装JDK

参考此文

Haskell 复制代码
# 更新JDK
brew tap AdoptOpenJDK/openjdk

# 安装JDK
brew install adoptopenjdk8

# 切换root用户
sudo -i

# 编辑环境变量(必须以root用户编辑,否则修改不了)
sudo /usr/bin/vim /etc/profile

JAVA_HOME=/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home
CLASS_PATH="$JAVA_HOME/lib"
PATH=".$PATH:$JAVA_HOME/bin"
export PATH=/usr/local/bin:$PATH

# 再切换回普通用户
exit

# 查看用户
whoami

# 查看是否设置成功
java -version

三、HomeBrew安装Git

Haskell 复制代码
# 安装git
brew install git

# 查看是否安装成功
git --version

# git全局配置
git config --global user.name 'jak' 
git config --global user.email 'xxx@qq.com'

# 用户密码登录
用户名:xxx@qq.com
密码:xxx

四、HomeBrew安装maven

Haskell 复制代码
# 安装maven
brew install maven

# 查看是否安装成功
mvn --vserion

# 查看maven目录
brew --prefix maven

# setting目录
/opt/homebrew/Cellar/maven/3.9.7/libexec

五、Mac安装IDEA

官网直接下载最新的IDEA官网,其余参考参考这个

关闭SIP

Haskell 复制代码
# 需要先关闭mac电脑SIP,否则会报错
mac M3 芯片,长按开机键进入恢复模式,实用工具终端里执行

# 关闭
csrutil disable 

# 开启
csrutil enable 

# 执行脚步
sudo bash install.sh

# 执行完脚本以后电脑关机打开idea输入激活码
X9MQ8ML8U7-eyJsaWNlbnNlSWQiOiJYOU1ROE1MOFU3IiwibGljZW5zZWVOYW1lIjoi5YWs5LyX5Y+377ya5a6J5a6J6K+05YmN56uvIiwiYXNzaWduZWVOYW1lIjoi5LuF5L6b5aix5LmQ5rWL6K+V77yM5q2j54mI5om+5YWs5Ly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v6vpcDkBo0XvuQwmZnbpf/Ndpy4ypP2OXIw94TlfOkGKVLdHDQU8ES1HpgAtscFtNg4dyZijF4pLgiK2nbCokvHI3oWQZY3ROswrjsh0HNHWdVKooEhWt3vBpXorusNRNWbwidznxySM5aABbHrlW0+EgXuLMEHBrybLu0QenEuTFZS3E91uSa7JLpU92aQyAmZUJAhogfIvssgwnmyfnOF3csixUV6lDBCf+SUGzQbYtZd/QsGI9uUUhBbLjoZnFhVEbbOntmB4/aUvSziZnbhRAY+OhVTrNX6GtXI03cAxVBk2Kh6DE62vBW3biBGHK5ClsQGW1f5RLWhqJh0d3EP6+dsAo2P3Ic5MCuspFwSfWoK3gNhvYlr57PNrzAWhBn6Od78RMaqg+dl+GHsm5sW5mbvXpvYNukEe1RHVIONl8OTKex1U12DeS4pAIA9aQxd1vYapmNdam3rnOQbynKLYa09aDPrWO5Y+LtaCix7TBmwXPtyCxBLK4S7EZ+FE7Xz322ulpKcvLZCTKBzUH5y62xHIcSijnxJfSU0W5UCApsnwochM5S6RPuVpvyQoBR5IX3Ugjw48jpuf2TGL/INWPHQ5AjK9ZNtWAfpkYc9w+AcNAa/v6J/Ha
相关推荐
小路恢弘5 小时前
使用Mac自带共享实现远程操作
macos
阿髙13 小时前
macos 隐藏、加密磁盘、文件
macos
minos.cpp16 小时前
Mac上Stable Diffusion的环境搭建(还算比较简单)
macos·ai作画·stable diffusion·aigc
追光天使1 天前
Mac/Linux 快速部署TiDB
linux·macos·tidb
wzkttt1 天前
Mac gfortran编译fortran出错
macos·gfortran
刘小哈哈哈1 天前
iOS 多个输入框弹出键盘处理
macos·ios·cocoa
草明1 天前
macOS 显示或不显示隐藏文件
macos
刘贤松1 天前
构建MacOS应用小白教程(打包 & 签名 & 公证 & 上架)
macos
power_to_go1 天前
macOS 配置 vscode 命令行启动
ide·vscode·macos
南山十一少1 天前
在 Mac M2 上安装 PyTorch 并启用 MPS 加速的详细教程与性能对比
macos