个人记录

进入目录

cd /usr/local/

JDK下载与配置

OpenJDK官网

下载安装

wget https://download.java.net/openjdk/jdk18/ri/openjdk-18+36_linux-x64_bin.tar.gz

Centos7下docker的jenkins下载并配置jdk与maven【图文教程】_apache

解压

tar -zxvf openjdk-18+36_linux-x64_bin.tar.gz
ls
ls jdk-18/

Centos7下docker的jenkins下载并配置jdk与maven【图文教程】_jenkins_02

编辑配置文件

vim /etc/profile

配置环境变量

export JAVA_HOME=/usr/local/jdk-18
export PATH=$PATH:${JAVA_HOME}/bin

Centos7下docker的jenkins下载并配置jdk与maven【图文教程】_apache_03

刷新配置

source /etc/profile

检查是否安装成功

java

Centos7下docker的jenkins下载并配置jdk与maven【图文教程】_maven_04

Maven下载与配置

Maven下载地址,右键复制链接地址,替换如下链接。粘贴至centos7下载

Centos7下docker的jenkins下载并配置jdk与maven【图文教程】_java_05

下载

wget https://dlcdn.apache.org/maven/maven-3/3.9.6/binaries/apache-maven-3.9.6-bin.tar.gz --no-check-certificate

解压

tar -zxvf apache-maven-3.9.6-bin.tar.gz

查看是否解压成功

ls

Centos7下docker的jenkins下载并配置jdk与maven【图文教程】_docker_06

编辑配置文件

vim /etc/profile

配置环境变量

export MAVEN_HOME=/usr/local/apache-maven-3.9.6
export PATH=$PATH:${MAVEN_HOME}/bin

Centos7下docker的jenkins下载并配置jdk与maven【图文教程】_jenkins_07

刷新配置

source /etc/profile

检查是否成功

mvn -v

Centos7下docker的jenkins下载并配置jdk与maven【图文教程】_docker_08

配置jenkins

打开System

Centos7下docker的jenkins下载并配置jdk与maven【图文教程】_maven_09


找到全局属性(global properties)添加如下。

PATH
/usr/local/jdk-18/bin:/usr/local/apache-maven-3.9.6/bin

Centos7下docker的jenkins下载并配置jdk与maven【图文教程】_apache_10