SonarQube version for Java8

I wanted to use the SonarQube version which supports the Java 8 as my application code has Java 8 Used and while i am scanning my code and performing the code analysis using Sonar i am getting below error:

**[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:4.0.0.4121:sonar (default-cli) on project *: Execution default-cli of goal org.sonarsource.scanner.maven:sonar-maven-plugin:4.0.0.4121:sonar failed: Unable to load the mojo ‘sonar’ in the plugin ‘org.sonarsource.scanner.maven:sonar-maven-plugin:4.0.0.4121’ due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: org/sonarsource/scanner/maven/SonarQubeMojo 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

154[ERROR] -----------------------------------------------------

155[ERROR] realm = plugin>org.codehaus.mojo:sonar-maven-plugin:4.0.0.4121

156[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy

157[ERROR] urls[0] = file:/home/ubuntu/.m2/repository/org/sonarsource/scanner/maven/sonar-maven-plugin/4.0.0.4121/sonar-maven-plugin-4.0.0.4121.jar

158[ERROR] urls[1] = file:/home/ubuntu/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.4/plexus-sec-dispatcher-1.4.jar

159[ERROR] urls[2] = file:/home/ubuntu/.m2/repository/org/codehaus/plexus/plexus-utils/1.5.5/plexus-utils-1.5.5.jar

160[ERROR] urls[3] = file:/home/ubuntu/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar

161[ERROR] urls[4] = file:/home/ubuntu/.m2/repository/org/sonarsource/scanner/api/sonar-scanner-api/2.16.3.1081/sonar-scanner-api-2.16.3.1081.jar

162[ERROR] urls[5] = file:/home/ubuntu/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar

163[ERROR] Number of foreign imports: 1

164[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]

165[ERROR]

166[ERROR] -----------------------------------------------------

167[ERROR]

168[ERROR] → [Help 1]

169[ERROR]

170[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

171[ERROR] Re-run Maven using the -X switch to enable full debug logging.

172[ERROR]

173[ERROR] For more information about the errors and possible solutions, please read the following articles:

174[ERROR] [Help 1] PluginContainerException - Apache Maven - Apache Software Foundation

175Error: Process completed with exit code 1.

Please help me to resolve this issue and use the right version if this SonarQube version error. Currently I am using *** Community Edition**
*** v10.6**

Hi @Ravikumar2 ,

The error message indicates that you need to run the SonarQube scanner with a JRE 8 version that is compatible with SonarServer 10.6.

It is important to understand that the JRE version used by the scanner is independent of the Java version of the code being analyzed.

In other words, even if your application uses Java 8, the SonarQube scanner must use a JRE 17 which is compatible with SonarServer.

Here are the steps to solve this problem:

  1. Check the JRE version used by your SonarQube scanner. You can usually find this information in the scanner configuration or in the log files.
  2. Make sure that the JRE version used by your scanner is compatible with SonarServer 10.6 . You can find information about compatible JRE versions in the official SonarQube documentation. SonarScanner requirements | SonarQube Server Documentation
  3. Reconfigure your SonarQube scanner to use the new JRE version.

Once you have updated your JRE and reconfigured the scanner, you should be able to run the code analysis without encountering the error.