当前位置:网站首页>Jenkins容器安装ruby-runtime插件失败报错解决
Jenkins容器安装ruby-runtime插件失败报错解决
2022-06-22 16:39:00 【非著名运维】
报错信息:
java.lang.RuntimeException: unsupported Java version: 11
at org.jruby.RubyInstanceConfig.initGlobalJavaVersion(RubyInstanceConfig.java:1674)
at org.jruby.RubyInstanceConfig.<clinit>(RubyInstanceConfig.java:1387)
Caused: java.lang.ExceptionInInitializerError
at org.jruby.embed.internal.AbstractLocalContextProvider.<init>(AbstractLocalContextProvider.java:42)
at org.jruby.embed.internal.SingleThreadLocalContextProvider.<init>(SingleThreadLocalContextProvider.java:43)
at org.jruby.embed.ScriptingContainer.getProviderInstance(ScriptingContainer.java:242)
at org.jruby.embed.ScriptingContainer.<init>(ScriptingContainer.java:226)
at org.jruby.embed.ScriptingContainer.<init>(ScriptingContainer.java:192)
at org.kohsuke.stapler.jelly.jruby.JRubyFacet.<init>(JRubyFacet.java:65)
at ruby.RubyRuntimePlugin.registerJRubyFacet(RubyRuntimePlugin.java:39)
at ruby.RubyRuntimePlugin.start(RubyRuntimePlugin.java:30)
at hudson.ClassicPluginStrategy.startPlugin(ClassicPluginStrategy.java:408)
at hudson.ClassicPluginStrategy.load(ClassicPluginStrategy.java:397)
Caused: java.io.IOException: Failed to initialize
at hudson.ClassicPluginStrategy.load(ClassicPluginStrategy.java:400)
at hudson.PluginManager.dynamicLoad(PluginManager.java:922)
Caused: java.io.IOException: Failed to install ruby-runtime plugin
at hudson.PluginManager.dynamicLoad(PluginManager.java:934)
at hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:2183)
Caused: java.io.IOException: Failed to dynamically deploy this plugin
at hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:2187)
at hudson.model.UpdateCenter$DownloadJob.run(UpdateCenter.java:1850)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at hudson.remoting.AtmostOneThreadExecutor$Worker.run(AtmostOneThreadExecutor.java:121)
at java.base/java.lang.Thread.run(Thread.java:829)
解决:
从上面的报错信息分析可能是由于Jenkins容器中的Java 11版本过高。我们单独下载一个低版本的jdk,然后将低版本的jdk拷贝到Jenkins容器中替换掉之前的Java 11版本。
[[email protected] ~]# wget https://builds.openlogic.com/downloadJDK/openlogic-openjdk/8u262-b10/openlogic-openjdk-8u262-b10-linux-x64.tar.gz //下载jdk8
[[email protected] ~]# ll openlogic-openjdk-8u262-b10-linux-x64.tar.gz
-rw-r--r-- 1 root root 104479130 7月 26 2020 openlogic-openjdk-8u262-b10-linux-x64.tar.gz
[[email protected] ~]# docker ps | grep jenkins
2324d2daa74d jenkins/jenkins:lts "/sbin/tini -- /usr/…" 6 weeks ago Up 2 hours 0.0.0.0:8080->8080/tcp, 0.0.0.0:50000->50000/tcp jenkins
[[email protected] ~]# docker cp openlogic-openjdk-8u262-b10-linux-x64.tar.gz jenkins:/usr/local/ //将下载的jdk拷贝到jenkins容器中
[[email protected] ~]# docker exec -it -u root jenkins /bin/bash //进入jenkins容器
[email protected]:/# java -version //可以看到现在jenkins容器的jdk版本是11.0.12
openjdk version "11.0.12" 2021-07-20
OpenJDK Runtime Environment Temurin-11.0.12+7 (build 11.0.12+7)
OpenJDK 64-Bit Server VM Temurin-11.0.12+7 (build 11.0.12+7, mixed mode)
[email protected]:/# cd /usr/local/
[email protected]:/usr/local# tar -xvf openlogic-openjdk-8u262-b10-linux-x64.tar.gz //解压我们刚才拷贝到jenkins容器中的jdk低版本
[email protected]:/usr/local# ls
bin games lib openlogic-openjdk-8u262-b10-linux-64 sbin src
etc include man openlogic-openjdk-8u262-b10-linux-x64.tar.gz share
[email protected]:/usr/local# mv openlogic-openjdk-8u262-b10-linux-64/ jdk8 //将解压后的jdk低版本目录名称修改为jdk8
[email protected]:/usr/local# ls
bin etc games include jdk8 lib man openlogic-openjdk-8u262-b10-linux-x64.tar.gz sbin share src
[email protected]:/usr/local# whereis java //查看jenkins容器中的java安装位置
java: /opt/java/openjdk/bin/java
[email protected]:/usr/local# mv /opt/java/openjdk/bin/java /opt/java/openjdk/bin/java11.bak //备份jenkins容器中的原java11版本
[email protected]:/usr/local# ln -s /usr/local/jdk8/bin/java /opt/java/openjdk/bin/java //将/usr/local/jdk8/bin/中低版本的java作为/opt/java/openjdk/bin/中的java软连接
[email protected]:/usr/local# java -version //查看“替换”后的java版本
openjdk version "1.8.0-262"
OpenJDK Runtime Environment (build 1.8.0-262-b10)
OpenJDK 64-Bit Server VM (build 25.71-b10, mixed mode)
再次安装ruby-runtime插件,若还是失败,可以在Jenkins首页重启一下再安装即可。(重启Jenkins后ruby-runtime插件默认就会加载成功)
插件安装完成后我们再将Jenkins容器中的Java版本修改回来。(根据情况,也可以不改回来)
[email protected]:~# rm -rf /opt/java/openjdk/bin/java #删除了之前替换的java8
[email protected]:~# mv /opt/java/openjdk/bin/java11.bak /opt/java/openjdk/bin/java #换回了java11
[email protected]:~# java -version
openjdk version "11.0.12" 2021-07-20
OpenJDK Runtime Environment Temurin-11.0.12+7 (build 11.0.12+7)
OpenJDK 64-Bit Server VM Temurin-11.0.12+7 (build 11.0.12+7, mixed mode)边栏推荐
- Using stream API instead of SQL
- GPIO operation method of imx6ull
- Xftp 7 (ftp/sftp client) v7.0.0107 official Chinese free official version (with file + installation tutorial)
- 知乎热问:一个程序员的水平能差到什么程度?
- 0 basic how to get started software testing, can you succeed in changing careers?
- math_角函数&反三角函数
- Short video with goods source code, save pictures to photo album / Gallery
- Behind the fall of the first Seberg: the extreme race between technology and frostbite
- 抢先报名丨新一代 HTAP 数据库如何在云上重塑?TiDB V6 线上发布会即将揭晓!
- 【 outils】 utilisation de PIP et de conda
猜你喜欢

利用Inkscape转换为dxf文件的正确方法 svg导出dxf文件

Fluentd is easy to get started. Combined with the rainbow plug-in market, log collection is faster

Tasks and responsibilities of the test team and basic concepts of testing

Pytorch——报错解决:“torch/optim/adamw.py” beta1, UnboundLocalError: local variable ‘beta1‘

国产手机干翻苹果?原来是靠百元机和猛降价实现的

Binary tree practice the second bullet

UI automation positioning edge -xpath actual combat

##Kibana+ELK集群日志处理

STM32系列(HAL库)——F103C8T6硬件SPI点亮带字库OLED屏

Missing value handling
随机推荐
Which platform is safer to buy stocks on?
<JVM上篇:内存与垃圾回收篇>08-对象实例化及直接内存
Behind the fall of the first Seberg: the extreme race between technology and frostbite
Quartus prime 18.0 software installation package and installation tutorial
What is flush software? Is it safe to open an account online?
TypeScript(7)泛型
Interview shock 58: Six differences among truncate, delete and drop!
JSP learning (I) -- overview of JSP
How to solve the problem of database?
Pytorch——报错解决:“torch/optim/adamw.py” beta1, UnboundLocalError: local variable ‘beta1‘
How to do well in R & D efficiency measurement and index selection
面试突击58:truncate、delete和drop的6大区别!
When online and offline integration accelerates and information docking channels are diversified, the traditional center will not be necessary
大一女生废话编程爆火!懂不懂编程的看完都拴Q了
[small program project development -- Jingdong Mall] rotation chart of uni app development
A new mode of enterprise software development: low code
数据库行业分析:从全球IT产业趋势到国产数据库发展之路
Mybaits: interface proxy implementation Dao
Nuxt - Universal (SSR / SSG) / single page app (rendering mode)
[applet project development -- Jingdong Mall] subcontracting configuration of uni app development