system-dev
system-dev

Reputation: 331

How to fix sonar plugin issue in jenkins

How to avoid issue with sonar scanner plugin on Jenkins 2.289.2, plugin sonar 2.13.1 when compiling a project I got the error

[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.0.2155:sonar (default-cli) on project maven-project: 
Execution default-cli of goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.0.2155:sonar failed: 
An API incompatibility was encountered while executing org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.0.2155:sonar: 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

It looks like an issue with the version of java but I would like to avoid changing my java version

Upvotes: 10

Views: 17987

Answers (1)

Adir Dayan
Adir Dayan

Reputation: 1617

Probably the compiled code you trying to run was compiled using java 11, but in env installed only java 8.

Try to install java 11 and make sure to update OS environment settings to point to the new JDK.

Java Details:

  • Java 8 uses major version 52
  • Java 11 uses major version 55

Upvotes: 7

Related Questions