# java.lang.UnsupportedClassVersionError in sonar 9.1 developer version

**URL:** <https://community.sonarsource.com/t/java-lang-unsupportedclassversionerror-in-sonar-9-1-developer-version/53738>\
**Category:** SonarQube Server / Community Build\
**Tags:** 8-9-lts-upgrade\
**Created:** [November 25, 2021, 5:18am UTC](https://community.sonarsource.com/t/java-lang-unsupportedclassversionerror-in-sonar-9-1-developer-version/53738 "2021-11-25T05:18:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dhilip](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/dhilip/32/27694_2.png) [@dhilip](https://community.sonarsource.com/u/dhilip)\
**Post date:** [November 25, 2021, 5:18am UTC](https://community.sonarsource.com/t/java-lang-unsupportedclassversionerror-in-sonar-9-1-developer-version/53738/1 "2021-11-25T05:18:41Z")

</div>

We are recently upgraded 9.1 developer edition since jenkins getting error below  
ERROR: Error during SonarScanner execution  
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  
at java.lang.ClassLoader.defineClass1(Native Method)  
both jenkins and sonar container using jdk 11 .  
kindly someone help us

---

<div class="post-metadata">

**Author:** ![anon67236913](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@anon67236913](https://community.sonarsource.com/u/anon67236913)\
**Post date:** [November 25, 2021, 6:24am UTC](https://community.sonarsource.com/t/java-lang-unsupportedclassversionerror-in-sonar-9-1-developer-version/53738/2 "2021-11-25T06:24:33Z")

</div>

Hi,

with Sonarqube 9, Java 11 is required for all scanners.  
In your case - even if Jenkins runs with jdk11 - the analysis still uses Java 8 (class file version 52.0), has to be Java 11 (class file version 55.0) instead.

see  
[https://docs.sonarqube.org/latest/analysis/analysis-with-java-11/](https://docs.sonarqube.org/latest/analysis/analysis-with-java-11/)

Gilbert

---

<div class="post-metadata">

**Author:** ![dhilip](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/dhilip/32/27694_2.png) [@dhilip](https://community.sonarsource.com/u/dhilip)\
**Post date:** [November 25, 2021, 9:07am UTC](https://community.sonarsource.com/t/java-lang-unsupportedclassversionerror-in-sonar-9-1-developer-version/53738/3 "2021-11-25T09:07:33Z")

</div>

added java home in global tools configuration

 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/3/9/3996a00c29ceda4b6626379edc89c9b5ed682693.png)  
getting below error : /home/jenkins/tools/hudson.plugins.sonar.SonarRunnerInstallation/sonarqube/bin/sonar-scanner  
Could not find ‘java’ executable in JAVA\_HOME or PATH.

---

<div class="post-metadata">

**Author:** ![anon67236913](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@anon67236913](https://community.sonarsource.com/u/anon67236913)\
**Post date:** [November 26, 2021, 7:14am UTC](https://community.sonarsource.com/t/java-lang-unsupportedclassversionerror-in-sonar-9-1-developer-version/53738/4 "2021-11-26T07:14:20Z")

</div>

you have to use a Java11 configured via `https://somejenkinshost/configureTools/` like that, i.e.

```auto
nodejs(configId: '...', nodeJSInstallationName: 'NodeJS 14.15') {
  withSonarQubeEnv(sonarenv) {
    withMaven(jdk: '...', maven: "...", globalMavenSettingsConfig: '...') {
      sh("mvn ... sonar:sonar ${sqProjectVersion ? "-Dsonar.projectVersion=$sqProjectVersion" : ''} -Dsonar.branch.name=$BRANCH_NAME")
    }
  }
}

```

when `sonarenv` is your configured Sonarqube server and `jdk` used within `withMaven` scope  
has to be a jdk 11.  
The `nodejs` block around is optional, but it’s a must when no nodejs on path and you need to  
scan also js, typescript or css.
