各种环境下各种包的安装

  1. centos7下
    1. java
    2. gradle
    3. maven
    4. go
    5. git
    6. docker
    7. docker-compse
    8. Redis
    9. Mysql
  2. windows下
    1. java
    2. go
  3. mac下
    1. java
    2. mysql
    3. go

centos7下

java

下载安装包
登录oracle网站下载安装包
https://www.oracle.com/java/technologies/downloads/

选择jdk-11.0.13_linux-x64_bin.tar.gz

创建安装目录

mkdir /usr/local/java/

解压至安装目录

tar -zxvf jdk-8u171-linux-x64.tar.gz -C /usr/local/java/

环境变量

vim /etc/profile

export JAVA_HOME=/usr/local/java/jdk-11.0.13
export PATH=${JAVA_HOME}/bin:$PATH
source /etc/profile

查看是否成功

java -version

gradle

下载地址

https://gradle.org/releases/

解压

unzip gradle-6.9.1-all.zip 
mkdir -p /usr/local/gradle
mv gradle-6.9.1/* /usr/local/gradle/

输入

export PATH=$PATH:/usr/local/gradle/bin
source /etc/profile

查看是否成功

gradle --version

maven

wget https://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz
tar -xf apache-maven-3.6.3-bin.tar.gz -C /usr/local/
vi /etc/profile
export PATH=$PATH:/usr/local/apache-maven-3.6.3/bin
source /etc/profile

查看是否成功

mvn -v

go

下载地址 https://studygolang.com/dl

wget https://studygolang.com/dl/golang/go1.17.6.linux-amd64.tar.gz
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.17.6.linux-amd64.tar.gz
vi /etc/profile

#加入
export PATH=$PATH:/usr/local/go/bin
export GOPATH=/root/go/

source /etc/profile
#查看是否成功
go version

git

yum install -y git

docker


docker-compse

运行此命令下载docker compose的当前稳定版本:

sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

对二进制文件应用可执行权限

sudo chmod +x /usr/local/bin/docker-compose

创建链接

ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

查看版本

# docker-compose --version
docker-compose version 1.24.1, build 4667896b

Redis

yum install -y redis
mkdir -p ~/.redis 
cp /etc/redis.conf ~/.redis/ #配置文件
vi ~/.redis/redis.conf #把daemonize改为yes,redis可以在后台运行;bind设置0.0.0.0允许所有服务器连接;requirepass设置密码
redis-server ~/.redis/redis.conf #后台运行服务端

redis-cli #进入客户端
ping #发送ping,返回pong

set testkey testvalue #设置kv
get testkey #根据k获取v
"testvalue"

Mysql

wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm

rpm -ivh mysql-community-release-el7-5.noarch.rpm

yum install -y mysql-server

systemctl start mysqld.service

service mysqld status

mysql -u root -p

use mysql

update user set password=password('你设置的密码') where User='root' ;

flush privileges;

service mysqld restart

CREATE DATABASE  `openapi` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

windows下

java

go

下载地址 https://studygolang.com/dl

下载双击安装

设置环境变量

查看是否成功

go version

mac下

java

下载 https://www.oracle.com/java/technologies/downloads/#java11-mac

安装后

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-11.0.14.jdk
export PATH=${JAVA_HOME}/bin:$PATH

mysql

下载 https://dev.mysql.com/downloads/file/?id=510017

安装后

export PATH=/usr/local/mysql-8.0.28-macos11-x86_64/bin:$PATH

go

下载https://golang.google.cn/dl/

设置环境变量


转载请注明来源

×

喜欢就点赞,疼爱就打赏