java.lang.UnsupportedClassVersionError org/sonar/batch/bootstrapper/EnvironmentInformation

  • sonarQube9.0.1 CE(Java 11 ) + pgsql (docker install) 。 my project is Java 8

when i excute mvn sonar:sonar,my project failed

[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin: (default-cli) on project product-service: 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
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.codehaus.mojo:sonar-maven-plugin:
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/D:/project/repository/org/sonarsource/scanner/maven/sonar-maven-plugin/
[ERROR] urls[1] = file:/D:/project/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.4/plexus-sec-dispatcher-1.4.jar

by the way, sonarqube9 needs java 11 means my project also needs java 11?


Welcome to the community!

Not at all. You can build your project with (or to) Java 8 and then analyze with Java 11. The docs talk about this.


1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.