October 27, 2024
Chicago 12, Melborne City, USA
java

Jenkins SonarQube Scanner Fails with UnsupportedClassVersionError – No JDK Listed in Job Configuration


I’m setting up a Jenkins job to run SonarQube analysis on my Java project, but I’m encountering an issue with Java version compatibility.


Problem Details
In my Jenkins job log, I see the following error:
“Error: LinkageError occurred while loading main class org.sonarsource.scanner.cli.Main
java.lang.UnsupportedClassVersionError: org/sonarsource/scanner/cli/Main has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0

What I Have Tried
I understand that class file version 61.0 corresponds to Java 17, but it seems like Jenkins is using an older Java version.
I tried setting the JDK in my SonarQube Scanner build configuration, but the dropdown is empty.

My Questions
1- How can I add Java 17 to Jenkins so that it appears in the JDK dropdown?
2- Are there additional steps required to configure Jenkins to use Java 17 for SonarQube analysis?
Thanks for any help on resolving this issue!



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video