Linux安装jdk和maven
1. 安装jdk
- 从oracle官网下载Java1.8
- 将下载的tar包上传到Linux环境中,本人环境目录/usr/local/env
- 解压tar -zxvf jdk-8u351-linux-x64.tar.gz
- 配置jdk环境变量:sudo vim etc/profile
export JAVA_HOME=/usr/local/env/jdk1.8.0_351
export CLASSPATH=$:CLASSPATH:$JAVA_HOME/lib/
export PATH=$PATH:$JAVA_HOME/bin`
- 刷新环境变量使其生效
source /etc/profile - 查看是否安装成功:java -version
2.安装maven
- 下载maven包:https://maven.apache.org/download.cgi
- 将下载的tar包上传到Linux环境中,本人环境目录/usr/local/env
- 解压tar -zxvf apache-maven-3.8.6-bin.tar.gz
- 配置jdk环境变量:sudo vim etc/profile
# maven
export MAVEN_HOME=/usr/local/env/apache-maven-3.8.6
export PATH=$MAVEN_HOME/bin:$PATH
- 刷新环境变量使其生效
source /etc/profile - 查看是否安装成功:mvn -v