1、下载
1.1 下载地址
- maven
- java
2、上传openjdk和maven压缩包到服务器

3、配置环境变量
3.1 编辑bash_profile
cd ~
vim .bash_profile
3.2 .bash_profile配置如下:
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
# java env
JAVA_HOME=/opt/java/openjdk-8u
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME
export PATH
# maven env
export MAVEN_HOME=/opt/maven/apache-maven-3.8.4
export PATH=$MAVEN_HOME/bin:$PATH
3.3 保存.bash_profile
:wq
3.4 使文件生效
source .bash_profile
4、检测是否配置成功
java -version

mvn -version
