# Sonar code compilcation

**URL:** <https://community.sonarsource.com/t/sonar-code-compilcation/116085>\
**Category:** SonarQube Cloud\
**Created:** [May 27, 2024, 7:40pm UTC](https://community.sonarsource.com/t/sonar-code-compilcation/116085 "2024-05-27T19:40:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sairaj123](https://avatars.discourse-cdn.com/v4/letter/s/ecae2f/32.png) [@sairaj123](https://community.sonarsource.com/u/sairaj123)\
**Post date:** [May 27, 2024, 7:40pm UTC](https://community.sonarsource.com/t/sonar-code-compilcation/116085/1 "2024-05-27T19:40:59Z")

</div>

I am scanning my JDK 8 project. In sonar code analysis pipelines we are using JDK 11.

I am getting this error currently…I am using sonar version 10.4.1

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 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0

What could be the issues? I tried changing jdk versions in pipelines and tried to use sonar.java.source=11 as per the docs…

can anyone suggest what is the procedure here i need to follow to analyze my jdk 8 project with sonar version 10.4.1 ?

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [May 29, 2024, 7:15am UTC](https://community.sonarsource.com/t/sonar-code-compilcation/116085/2 "2024-05-29T07:15:30Z")

</div>

Hey there.

Take a look at the documentation on [Scanner Environment](https://docs.sonarsource.com/sonarcloud/appendices/scanner-environment/)

> ### [Maven / Gradle](https://docs.sonarsource.com/sonarcloud/appendices/scanner-environment/#maven-gradle)
> 
> If your whole Maven or Gradle build doesn’t run on Java 17, we suggest first to try to base the whole build on one of those versions of Java. If it’s not compatible, then you can override the `JAVA_HOME` environment variable just before the analysis step, as shown here:
> 
> ```auto
> # Maven
> mvn verify ...
> export JAVA_HOME=/path/to/java17
> mvn sonar:sonar ...
> 
> ```
