CentOS 7 下安装 JDK、Maven、Git
下载文件
- JDK
- jdk-8u202-linux-x64.tar.gz
- Maven
- apache-maven-3.6.3-bin.tar.gz
Java 安装
mkdir /usr/local/java
tar zxvf jdk-8u202-linux-x64.tar.gz -C /usr/local/java
vim /etc/profile
export JAVA_HOME=/usr/local/java/jdk1.8.0_202
export CLASSPATH=.:${JAVA_HOME}/jre/lib:${JAVA_HOME}/lib
export PATH=$PATH:${JAVA_HOME}/bin
source /etc/profile
java -version
Maven 安装
安装
mkdir /usr/local/maven
tar zxvf apache-maven-3.6.3-bin.tar.gz -C /usr/local/maven
vim /etc/profile
export MAVEN_HOME=/usr/local/maven/apache-maven-3.6.3
export PATH=$PATH:$JAVA_HOME/bin:$MAVEN_HOME/bin
source /etc/profile
mvn -version
加速镜像
vi /usr/local/maven/apache-maven-3.6.3/conf/settings.xml
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
Git 安装
安装
yum install -y git
git --version
配置
git config --global user.name "boazy"
git config --global user.email "boazy@126.com"
ssh-keygen -t rsa -C "boazy@126.com"
# 将公钥(/root/.ssh/id_rsa.pub)上传到 github