推荐下载
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
ruby下载
1、检查ruby
mac 自带 ruby , 查看版本 :
ruby -version
2、ruby 下载 Homebrew :
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
安装完成,检查是否OK:
brew
brew -h 帮助
brew -h
Example usage:
brew search TEXT|/REGEX/
brew info [FORMULA|CASK...]
brew install FORMULA|CASK...
brew update
brew upgrade [FORMULA|CASK...]
brew uninstall FORMULA|CASK...
brew list [FORMULA|CASK...]
Troubleshooting:
brew config
brew doctor
brew install --verbose --debug FORMULA|CASK
Contributing:
brew create URL [--no-fetch]
brew edit [FORMULA|CASK...]
Further help:
brew commands
brew help [COMMAND]
man brew
https://docs.brew.sh
-
formulae
意思是一些
软件包
,一般是命令行工具、开发库、一些字体、插件,共性是不提供界面,提供给终端或者是开发者使用。 -
cask
是
用户软件
,比如 chrome、mvim、wechat、wechatwork 这些提供用户交互界面的软件,图形化界面。
Homebrew 安装 maven
brew install maven
配置环境变量:
open ~/.bash_profile
添加以下内容 :
export M2_HOME=/usr/local/Cellar/maven/3.8.1/libexec
export PATH=$PATH:$M2_HOME/bin
安装配置完成,检查是否OK:
> mvn -version
Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d)
Maven home: /usr/local/Cellar/maven/3.8.1/libexec
Java version: 1.8.0_291,
vendor: Oracle Corporation,
runtime: /Library/Java/JavaVirtualMachines/jdk1.8.0_291.jdk/Contents/Home/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "mac os x", version: "10.16", arch: "x86_64", family: "mac"
版权声明:本文为sinat_31057219原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。