严重:以Java类版本53.0运行,但是Jenkins要求通过命令提示符"java -jar jenkins.war"将52.0出错. [英] SEVERE: Running with Java class version 53.0, but 52.0 is required error with Jenkins through command prompt as "java -jar jenkins.war"
问题描述
我是自动化工程师,我已经使用maven在Jenkins上部署了我的构建,我想在执行脚本时打开浏览器.我在它上搜索时,有人说我在尝试通过命令提示符运行Jenkins时通过cmd提示符运行Jenkins war文件:
I am automation engineer i have deployed my build on the Jenkins using maven, I want to when scripts are executed then the browser should open. I searched on it some peoples says my me Run the Jenkins war file through cmd prompt when I am trying to Run the Jenkins through command prompt as:
java -jar Jenkins.war
然后系统会产生如下错误:
Then the system generates an error as follows:
SEVERE: Running with Java class version 53.0, but 52.0 is required error
任何人都知道如何解决该问题吗?
Anyone have any idea how I can fix the problem?
推荐答案
此错误消息...
SEVERE: Running with Java class version 53.0, but 52.0 is required.
...表示您已尝试在使用 java类版本53.0 (代表 Java 9 )的系统上初始化 Jenkins
...implies that you have tried to initialize Jenkins on a system which is using java class version 53.0 which stands for Java 9.
根据 Java要求中的 Jenkins 文档提到以下内容:
As per the Jenkins documentation on Java requirements the following are mentioned:
- Java 8 是受 ONLY 支持的运行时环境,同时支持32位和64位版本.
- 不支持Java的旧版本. 不支持
- Java 9 . 提供
- Java 10 和 Java 11 预览支持.
- 可通过自定义程序包获得对这些版本的支持
- 使用Java 10和11运行Jenkins(实验性支持)页提供了有关在这些版本上运行Jenkins的准则.
- 这些要求适用于Jenkins系统的所有组件,包括Jenkins主服务器,所有类型的代理,CLI客户端和其他组件.
- Java 8 is the ONLY supported runtime environment, both 32-bit and 64-bit versions are supported.
- Older versions of Java are not supported.
- Java 9 is not supported.
- Java 10 and Java 11 preview support is available.
- Support of these versions is available through custom packages
- Running Jenkins with Java 10 and 11 (experimental support) page provides guidelines about running Jenkins with these versions.
- These requirements apply to all components of the Jenkins system including Jenkins master, all types of agents, CLI clients, and other components.
有两种可能的解决方案,如下所示:
There are two possible solutions as follows:
-
您可以将您的 Jenkins 主机 JRE 降级为 Java 8 版本,并按如下所示启动 Jenkins :
You can downgrade your Jenkins host JRE to Java 8 version and initiate Jenkins as follows:
${JAVA8_HOME}/bin/java -jar jenkins.war
您可以将您的 Jenkins 主机 JRE 升级到 Java 10 或 Java 11 版本并启动 Jenkins 以及 --enable-future-java
标志,如下所示:
You can upgrade your Jenkins host JRE to Java 10 or Java 11 version and initiate Jenkins along with the --enable-future-java
flag as follows:
${JAVA10_HOME}/bin/java -jar jenkins.war --enable-future-java
Java 10
- 下载2.127或更高版本的Jenkins WAR(或构建 实验分支 strong> )
-
使用以下命令运行Jenkins WAR文件:
- Download Jenkins WAR for 2.127 or above (or build the experimental branch)
Run the Jenkins WAR file with the following command:
${JAVA10_HOME}/bin/java --add-modules java.xml.bind -jar jenkins.war \
--enable-future-java --httpPort=8080 --prefix=/jenkins
Java 11
- 下载Jenkins WAR 2.127或更高版本(或构建 实验分支 )
- 将以下库下载到与jenkins.war相同的目录中
- jaxb-api-2.3.0.jar (另存为jaxb-api.jar)
- javax.activation v.1.2. 0 (另存为javax.activation.jar)
- Download Jenkins WAR for 2.127 or above (or build the experimental branch)
- Download the following libraries to the same directory as jenkins.war
- jaxb-api-2.3.0.jar (save as jaxb-api.jar)
- jaxb-core-2.3.0.1.jar (save as jaxb-core.jar)
- jaxb-impl-2.3.0.1.jar (save as jaxb-impl.jar)
- javax.activation v.1.2.0 (save as javax.activation.jar)
使用以下命令运行Jenkins WAR文件:
Run the Jenkins WAR file with the following command:
${JAVA11_HOME}/bin/java \ -p jaxb-api.jar:javax.activation.jar --add-modules java.xml.bind,java.activation \ -cp jaxb-core.jar:jaxb-impl.jar \ -jar jenkins.war --enable-future-java --httpPort=8080 --prefix=/jenkins
根据 Java类文件-Wikipedia ,以下是该类的主要版本号正在使用的文件格式:
As per Java class file - Wikipedia following are the major version number of the class file format being used:
Java SE 11 = 55 Java SE 10 = 54 Java SE 9 = 53 Java SE 8 = 52 Java SE 7 = 51 Java SE 6.0 = 50 Java SE 5.0 = 49 JDK 1.4 = 48 JDK 1.3 = 47 JDK 1.2 = 46 JDK 1.1 = 45
这篇关于严重:以Java类版本53.0运行,但是Jenkins要求通过命令提示符"java -jar jenkins.war"将52.0出错.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!