安装JDK并配置环境变量
1.查看JDK版本信息java -version
根据需求,把openjdk替换成oraclejdk
https://img2022.cnblogs.com/blog/2799649/202206/2799649-20220624134220096-398802054.png
如下图,显示java version 说明oraclejdk已经安装好了
https://img2022.cnblogs.com/blog/2799649/202206/2799649-20220624134046624-922725727.png
2.下载oraclejdk安装包
官网 - 历史版本下载地址:http://www.oracle.com/technetwork/java/javase/archive-139210.html
下载正确的安装包
https://img2022.cnblogs.com/blog/2799649/202206/2799649-20220624134740523-224821645.png 3. 安装+配置jdk
创建目录
mkdir -p /home/local/java
进入目录
cd /home/local/java
通过rz命令将文件上传到该目录
https://img2022.cnblogs.com/blog/2799649/202206/2799649-20220624135013901-1054982210.png
解压jdk压缩包
tar -zxvf jdk-8u271-linux-x64.tar.gz
配置环境变量
vim /etc/profile
将如下命令粘到末尾
https://img2022.cnblogs.com/blog/2799649/202206/2799649-20220624135411308-2110513292.png
注意:home/local/java/jdk1.8.0_45就是你自己的jdk目录
然后保存退出
重新加载配置文件
source /etc/profile
4.验证安装情况
输入 java -version
https://img2022.cnblogs.com/blog/2799649/202206/2799649-20220624135821165-2129917773.png
如图安装完毕
5.安装完毕启动jenkins报错
https://img2022.cnblogs.com/blog/2799649/202206/2799649-20220624152425558-1652747363.png
解决
which java
找到java的安装路径
https://img2022.cnblogs.com/blog/2799649/202206/2799649-20220624152515848-1485063365.png
编辑 jenkins
https://img2022.cnblogs.com/blog/2799649/202206/2799649-20220624152638920-1186907000.png
把which里面找到的java路径加在这里,保存退出
https://img2022.cnblogs.com/blog/2799649/202206/2799649-20220624152752510-47572430.png
启动jenkins正常
https://img2022.cnblogs.com/blog/2799649/202206/2799649-20220624152910592-725760318.png
https://img2022.cnblogs.com/blog/2799649/202206/2799649-20220624152946869-1112005243.png
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!
页:
[1]