1、Homebrew安装
ruby环境:curl -sSL https://get.rvm.io | bash -s stable
官网方式:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
替换及重置Homebrew默认源方法一:
替换brew.git:
cd "$(brew --repo)"
git remote set-url origin Index of /brew.git/
替换homebrew-core.git:
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin Index of /homebrew-core.git/
替换及重置Homebrew默认源方法二:
cd "$(brew --repo)" && git remote set-url origin https://git.coding.net/homebrew/homebrew.git
cd $home && brew
替换及重置Homebrew默认源方法三:
ruby brew_install
brew_install文件
# BREW_REPO = "https://github.com/Homebrew/brew".freeze
BREW_REPO = "git://mirrors.ustc.edu.cn/brew.git".freeze
CORE_TAP_REPO = "git://mirrors.ustc.edu.cn/homebrew-core.git".freeze
安装到homebrew的软件位置为: /usr/local/Cellar/
配置文件位置: /usr/local/etc
2、Redis安装
安装:
brew search redis
brew install redis@4.0
echo 'export PATH="/usr/local/opt/redis@4.0/bin:$PATH"' >> ~/.bash_profile
brew services start redis@4.0
修改redis配置文件:
Mac环境下安装配置Redis_mac安装redis-CSDN博客
Macintosh HD ▸ usr ▸ local ▸ etc ▸ redis.conf
3、Mysql安装
homebrew安装mysql:
brew search mysql
brew install mysql@5.7
echo 'export PATH="/usr/local/opt/mysql@5.7/bin:$PATH"' >> ~/.bash_profile
brew services start mysql@5.7
普通安装:
下载mysql-8.0.16-macos10.14-x86_64.dmg
cd /usr/local/bin
ln -fs /usr/local/mysql-8.0.16-macos10.14-x86_64/bin/mysql mysql
/usr/local/mysql/bin/mysql -u root -p
常用命令:
mysql -u root -p
show databases;
use mysql;
show tables;
quit;
MySQL基础 — 常用命令_mysql常用命令-CSDN博客
4、JDK安装
下载然后配置环境变量:https://jingyan.baidu.com/article/5552ef47e85780518ffbc991.html
MAC安装JDK及环境变量配置_mac下载java-CSDN博客
安装位置:Macintosh HD ▸ 资源库 ▸ Java ▸ JavaVirtualMachines
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home
CLASSPAHT=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
PATH=$JAVA_HOME/bin:$PATH:
export JAVA_HOME
export CLASSPATH
export PATH
5、RabbitMQ安装
brew install rabbitmq
echo 'export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"' >> ~/.bash_profile
brew services start rabbitmq
http://localhost:15672
密码:guest 账号:guest
cd /usr/local/Cellar/rabbitmq/3.7.15/sbin/
./rabbitmq-server restart
vi ~/.bash_profile
source ~/.bash_profile
6、Zookeeper安装
在mac OSX中安装启动zookeeper_mac 启动zookeeper-CSDN博客
brew install zookeeper
brew services start zookeeper
7、maven配置
vim ~/.bash_profile export M3_HOME=/Users/chenyang/java_utils/apache-maven-3.6.1 export PATH=$PATH:$M3_HOME/bin //mvn -v提示Permission denied 没有权限访问 chmod a+x /Users/chenyang/java_utils/apache-maven-3.6.1/bin/mvn
8、java环境变量
idea安装的jdk不需要配置,已经配置好了,可查询
9、tomcat和jenkins
运行tomcat:
//切换到对应的tomcat的bin目录: cd /Users/chenyang/java_utils/apache-tomcat-8.5.59/bin //此处要是越到没权限的,给下权限 sudo chmod 755 *.sh //启动 sh startup.sh //停止 sh shutdown.sh
‼️坑:通过brew安装android sdk,有缺失,通过android-sdk-macosx安装打不开manager
10、利用Android command-line-tools安装
2022 Mac上安装Android SDK_mac android_home=/users/gonglei/library/android/sd-CSDN博客
环境变量配置看这个
ANDROID_HOME="/Users/chenyang/Library/Android/sdk" export ANDROID_HOME export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools