[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:


Get Following error while integration with Jenkins and SonarQube for code quality pipeline.

[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin: (default-cli) on project MavenEclipseProject: Execution default-cli of goal org.sonarsource.scanner.maven:sonar-maven-plugin: failed: An API incompatibility was encountered while executing org.sonarsource.scanner.maven:sonar-maven-plugin: java.lang.UnsupportedClassVersionError: org/sonar/batch/bootstrapper/EnvironmentInformation has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

Jdk version in 1.8.0_202
Jenkins version Jenkins 2.319.2
SonarQube version * Community Edition

  • Version 9.3

Thanks in advance.

Hey there.

You will need to make sure you run the actual analysis with Java 11. See the documentation on Scanner Environment.

Thanks for prompt reply.

I change my JDK to 11. Build the project with JDK 11, Still get same error.


If Java 11 is telling you that it cannot recognize Java 11 class files, I think you have a larger issue :laughing:

How are you pointing to the Java 11 distribution? What steps did you take? What does your pipeline configuration look like? We cannot guess – so please add all the details you can.

Details metioned below. Hope this will help to analyse.


Scripted pipeline

stage(‘Code Quality’) {
steps {
echo ‘Code Quality’
withSonarQubeEnv(‘SonarQubeToken’) {
bat “mvn sonar:sonar”


What happens if you run java -version or mvn-version directly in your scripted pipeline? What output do you get?

Thanks Colin I got it resolved

@Khalid_Ansari can you please tell me what the problem was and how you resolve the issue.

I checked my Java version in Jenkins and rectified that it started running.

Can you please let me know how to check my java version in Jenkins through groovy script?

Facing same issue, even that I change my JDK to Version 11, it still throwing following error.
Shall I create new Thread or can you help here.
java -version
openjdk version “11.0.3” 2019-04-16
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.3+7)

The provided link is no longer available. Has it moved ?

You can find the Scanner Environment docs here. I’ll update the original link as well.