I'm trying to start Jenkins using:
java -jar jenkins.war
I got this error:
java.lang.UnsupportedClassVersionError: 54.0
at Main.main(Main.java:128)
This problem comes after an update of my development environment, I'd switched to :
Java 10.0.1+10
Jenkins 2.107.2
MacOS 10.13.4
Based on the error message that you are getting:
The JAR / WAR file being loaded was compiled for Java 10 (and later) because the message says that the classfile version is 54.
The JRE that is actually being used is Java 9 or earlier. If you were using Java 10, it would be happy with version 54.
In other words, despite upgrading your Java to Java 10, you must be using an older version to start Jenkins.
Check the launch script for Jenkins and make sure that it uses the correct JRE installation.
If you are launching Jenkins using java -jar jenkins.war, check what java -version tells you ... at the same command prompt.
An easier approach could be to download Jenkins WAR for 2.127 (weekly release) or above. Then one can run the war with the following command:
${JAVA10_HOME}/bin/java --add-modules java.xml.bind -jar jenkins.war \
--enable-future-java --httpPort=8080 --prefix=/jenkins
Though note that there are few known issues registered on their tracker :
Pipeline crashes immediately on Java 10 and 11 (JENKINS-46602)
There are many warnings about Illegal reflective access during execution (JENKINS-40689)
Configuration-as-Code plugin fails to export configurations on Java 10 (JENKINS-51991)
Here are the individual tracker for Java 10 compatiblity and one for Java 11.
Source - Jenkins with Java10-11
Related
I am unable to generate a folder/HTML report of jmeter in the command line.
I have previously upgraded to the latest java and somehow it did not work.
I have downloaded jdk8 but encountered this message below:
jmeter: line 128: [: : integer expression expected jmeter: line 199:
/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home -v
1.8.331.09/bin/java: No such file or directory
You're using wrong Java, you need to have JDK (or at least JRE) and you seem to be using Java browser plugin
Follow the instructions from Installation of the JDK on macOS article to get the required version of Java (not earlier than JDK 8) and make sure that it's in your PATH before the one which is provided by the browser plugin.
Also you can consider using Homebrew for installing JMeter.
More information: Get Started With JMeter: Installation & Tests
I have multiple Java versions installed. I switch versions when needed.
If I use Java 8 as default, SoapUI will use it. A Popup with with this error will show then :
java.lang.UnsupportedClassVersionError: com/eviware/soapui/SoapUI has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0
Since the 5.6.0, SoapUI need a Java version ⩾ 9. So I want to specify the java version used by SoapUI when my default version is java 8.
Notes :
By default I mean, the version printed when : java -version is executed on the Terminal.
In the file SoapUI-5.6.0/bin/SoapUI-5.6.0 :
Uncomment the var INSTALL4J_JAVA_HOME_OVERRIDE at the beginning of the file
Assign the java home (JRE OU JDK) to INSTALL4J_JAVA_HOME_OVERRIDE
Example :
INSTALL4J_JAVA_HOME_OVERRIDE=/usr/lib/jvm/jre-11/
I leave here my solution since i lost 4 hours just to understand that if you have java 8 and you use Ubuntu, you can save the world but SoapUI 5.6.0 won't work.
So the solution is to download an older version, like 5.4.0
Don't bother looking for one if you're an Ubuntu lady/guy, just use this command:
$ wget https://s3.amazonaws.com/downloads.eviware/soapuios/5.4.0/SoapUI-5.4.0-linux-bin.tar.gz
Then unzip and untar the downloaded archive:
$ gunzip SoapUI-5.4.0-linux-bin.tar.gz
$ tar xvf SoapUI-5.4.0-linux-bin.tar
Finally start SoapUI by entering in the folder where it is installed and run:
/bin/soapui.sh
in case it helps anyone - I have java-11 alongside java-8 (with latter being the default) and SoapUI-5.6.0.
Solution: I've set the INSTALL4J_JAVA_HOME_OVERRIDE variable in SoapUI-5.6.0 to:
INSTALL4J_JAVA_HOME_OVERRIDE="/usr/lib/jvm/java-11-openjdk-amd64/"
Just use nano or gedit, etc. to modify (don't forget to use elevated permissions, if neccessary).
Best regards
I have installed Java-11-openjdk-amd64 and ran it in auto in usr/lib/jvm/Java-11-openjdk-amd64/bin/java, and Scala 2.11.12 and spark 2.2.0 with hadoop 2.7 in my desktop having linux mint VM 19.2 running on windows 10. I am getting error opening spark-shell:
Failed to initialize compiler: object java.lang.Object in compiler mirror not found.
I also defined the variables in the .bashrc file in the home directory as follow:
export JAVA_HOME=/usr/lib/jvm/Java-11-openjdk-amd64
export SCALA_HOME=/usr/local/src/scala/scala-2.11.12
export SPARK_HOME=/usr/lib/spark/spark-2.2.0-bin-hadoop2.7
export PATH=$SCALA_HOME/bin:$JAVA_HOME/bin:$SPARK_HOME/bin:$PATH
How can I solve this? Do I have to change it into java 8 to run spark? I am trying to run it on java-8-openjdk-amd64 using update-alternatives --config java but I cannot change the selected java as it gives me another error: permission denied.
How can I move my java 8 to another folder using command line as I cannot do it manually? I am new to Linux and Spark..
You should use Java 8 since Spark depends heavily on some of the Java 8 features that where either made private, deprecated or removed in Java 9 and above.
Copy: https://www.webservertalk.com/copy-directory-folder-linux-cmd
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?
This error message...
SEVERE: Running with Java class version 53.0, but 52.0 is required.
...implies that you have tried to initialize Jenkins on a system which is using java class version 53.0 which stands for Java 9.
As per the Jenkins documentation on Java requirements the following are mentioned:
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.
Solution
There are two possible solutions as follows:
You can downgrade your Jenkins host JRE to Java 8 version and initiate Jenkins as follows:
${JAVA8_HOME}/bin/java -jar jenkins.war
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
Running Jenkins (without Docker)
Java 10
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
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)
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
trivia
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 -jar jenkins.war --enable-future-java
I have installed Java 15 on my system. To run Jenkins with Java 15, please execute the below command.
D:\Selenium\Jenkins>java -jar jenkins.war -httpPort=9090 --enable-future-java
Change path to your war file.
Jenkins is supported java version are 8,11 . jenkins not supported older versions and java 9,10,12 and 13 too , you have to downgrade java version to 8 or 11
You have to install JDK8 and set system environment variable 'path' to JDK8 /bin/ folder
As of now, Jenkins WAR support is compatible up to Java 8.
You are using 9.0.4, Which is higher version from Jenkins recommendation
You can still use Jenkins, With Windows service: Click Here to Download
I have Jenkins 2.46.3 LTS version that i am trying to upgrade to 2.73.3 LTS version. My current java version is 1.7. How do i install and start Jenkins with 1.8 version? I am getting the following error after i copied Jenkins war file under (/usr/lib/Jenkins) and restarted the service
$ sudo service jenkins start
Starting Jenkins Jenkins requires Java8 or later, but you are running 1.7.0_97-b02 from /app_2/java/jdk1.7.0_97/jre
java.lang.UnsupportedClassVersionError: 51.0
at Main.main(Main.java:124)
Is there any way to start Jenkins using Java 8 without changing the system classpath?
Thanks,
Ann
Set JENKINS_JAVA option in /etc/sysconfig/jenkins file.
The variable name might be different depending on your operating system and package source but the /etc/sysconfig/jenkins file is usually the configuration file for your jenkins service.
Just run the war with the new java binary:
nohup <path to your new jdk8 folder>/java -jar jenkins.war > $LOGFILE 2>&1
Not sure if JAVA_HOME is needed, but you can execute the line below in the shell, before the command above, or add to the top of init script :
export JAVA_HOME=<path to your new jdk8 folder>/java
Hope that helps.