作者:MrTkinG | 来源:互联网 | 2023-10-16 17:08
1 jdk 去网站下载,然后拷贝到linux上;或直接
wget http://download.oracle.com/otn-pub/java/jdk/8u181-b13/96a7b8442fe848ef90c96a2fad6ed6d1/jdk-8u181-linux-x64.tar.gz
解压
tar -zxf jdk-17_linux-x64_bin.tar.gz
配置:进入 /etc/profile
# /root/jdk-17.0.2 -> 需要替换为你放置java解压后的目录 JAVA_HOME=/root/jdk-17.0.2 JRE_HOME=/root/jdk-17.0.2/jre CLASS_PATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin export JAVA_HOME JRE_HOME CLASS_PATH PATH
让上面的配置生效
source /etc/profile
2 Svn仓库的安装 ,参考
https://blog.csdn.net/weixin_44451022/article/details/119802788?spm=1001.2014.3001.5501 # 其中,参数配置,是进入/home/svn/project/各个文件配置,不是一个文件直接粘贴
3 Maven的安装 4 Tomcat的安装 其中端口号无需修改,在apache-tomcat-9.0.58/conf/server.xml中加一下段 URIEncoding="UTF-8
5 jenkins安装
sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat/jenkins.repo sudo rpm --import https://pkg.jenkins.io/redhat/jenkins.io.key yum install fontconfig java-11-openjdk yum install jenkins
jenkins 运行不成功 systemctl status jenkins 碰到的有配置文件找不到java, 则在配置文件添加或软连接你的路径到/user/bin/java
whereis java # 得到java 路径 /root/jdk-17.0.2/bin/java # vim /etc/init.d/jenkins candidates=" /etc/alternatives/java /usr/lib/jvm/java-1.8.0/bin/java /usr/lib/jvm/jre-1.8.0/bin/java /usr/lib/jvm/java-11.0/bin/java /usr/lib/jvm/jre-11.0/bin/java /usr/lib/jvm/java-11-openjdk-amd64 /usr/bin/java /root/jdk-17.0.2/bin/java "
或者
ln -s /root/jdk-17.0.2/bin/java /usr/bin/java
jenkins运行报运行java没权限 将java权限升到最高也没解决的话,尝试配置
# 打开 /etc/sysconfig/jenkins,找到下面一句,将用户权限修改为root,后重启jenkins服务 # JENKINS_USER="jenkins" JENKINS_USER="root"
运行报java版本与jenkins 我是用参照的网站的jenkins,出现这个问题。然后使用jenkins官网推荐的方式下载了最先的,然后重启下jenkins就好了
sudo service jenkins restart # 查看启动状态 systemctl status jenkins # 预期:Active: active (running)
登录公网ip,确保 安全组 放行8080端口 网页登陆 ip:8080/jenkins/