迁移个人博客 http://www.husiqin.com
1.安装openjdk`
yum install java-1.8.0-openjdk
yum install java-1.8.0-openjdk-devel.x86_64
java -version
javac
安装路径
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.232.b09-0.el7_7.x86_64
2.安装jenkins
yum install wget -y
echo -e "\e[1;33;41m jenkis开始安装 \e[0m"
echo -e "\e[1;33;41m 安装yum源 \e[0m"
wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
echo -e "\e[1;33;41m 导入配置 \e[0m"
rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
echo -e "\e[1;33;41m 开始下载jenkis \e[0m"
yum -y install epel-release
yum -y install daemonize
yum install jenkins -y
echo -e "\e[1;33;41m jenkis安装目录为 \e[0m"
rpm -ql jenkins
echo -e "\e[1;33;41m 一定注意jdk路径图片见下 \e[0m"
echo -e "\e[1;33;41m 建立软连接或者修改 vim /etc/init.d/jenkins jdk路径 \e[0m"
ln -s /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.292.b10-1.el7_9.x86_64/bin/java /usr/bin/java
echo -e "\e[1;33;41m 开放端口8080 \e[0m"
systemctl start firewalld
firewall-cmd --zone=public --add-port=8080/tcp --permanent
firewall-cmd --reload
echo -e "\e[1;33;41m 开始启动 \e[0m"
systemctl daemon-reload
systemctl restart jenkins
echo -e "\e[1;33;41m 启动完成默认端口8080 \e[0m"
echo -e "\e[1;33;41m 如果修改端口则 vim /etc/sysconfig/jenkins \e[0m"
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/0256327f4c2cbc4668bfd62043b57c68.png#pic_center)