Error during SonarQube Scanner execution 16:37:36 java.lang.UnsupportedClassVersionError

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
  • Sonar 9.4
  • what are you trying to achieve
    -Jenkins jobs are failing with this error.
  • what have you tried so far to achieve this
  • Updated the Java version from 8 to 11 in Sonar server.

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

Hey there.

The version of Java on the SonarQube server won’t be of consequence here – what matters is the version of Java being executed during analysis.

Here is the documentation on Scanner Environment which should help.

Thanks for the response colin. Will go throught he guide.