准备
jdk安装包:jdk-8u91-linux-x64.tar.gz
maven安装包:apache-maven-3.5.3-bin.tar.gz
解压
tar -zxvf jdk-8u91-linux-x64.tar.gz -C /usr/local/
tar -zxvf apache-maven-3.5.3-bin.tar.gz -C /usr/local/
添加环境变量
编辑/ect/profile文件
#jdk配置
JAVA_HOME=/usr/local/jdk1.8.0_91
export JAVA_HOME
CLASSPATH=.:$JAVA_HOME/lib
export CLASSPATH
PATH=$PATH:$JAVA_HOME/bin:$CLASSPATH
export PATH
#maven配置
MAVEN_HOME=/usr/local/apache-maven-3.5.3
export MAVEN_HOME
PATH=$PATH:$MAVEN_HOME/bin
export PATH
#使得环境变量生效
source /etc/profile