# Getting java.lang.UnsupportedClassVersionError

**URL:** <https://community.sonarsource.com/t/getting-java-lang-unsupportedclassversionerror/118557>\
**Category:** SonarQube Server / Community Build\
**Created:** [July 8, 2024, 5:54am UTC](https://community.sonarsource.com/t/getting-java-lang-unsupportedclassversionerror/118557 "2024-07-08T05:54:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tanish\_Jain](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/tanish_jain/32/57989_2.png) [@Tanish\_Jain](https://community.sonarsource.com/u/Tanish_Jain)\
**Post date:** [July 8, 2024, 5:54am UTC](https://community.sonarsource.com/t/getting-java-lang-unsupportedclassversionerror/118557/1 "2024-07-08T05:54:55Z")

</div>

After upgrading Sonarqube to 10.6 and I’ve also migrated my sonarqube server and restore the old data that contains my all projects.

**But after running my pipelines sonar step is failing.**  
Here is the SS-

 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/9/0/907ea3ef4341acb15aef9e8c11e92fd28d7b827c.png)

In Sonarqube Pod, **my java version is this-**

 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/a/9/a9795fa65d0ce96d6becf3d8d4f4c018c1a8c37b.png)

---

<div class="post-metadata">

**Author:** ![aravindnss](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/aravindnss/32/69944_2.png) [@aravindnss](https://community.sonarsource.com/u/aravindnss)\
**Post date:** [July 8, 2024, 6:12am UTC](https://community.sonarsource.com/t/getting-java-lang-unsupportedclassversionerror/118557/2 "2024-07-08T06:12:58Z")

</div>

Hi @Tanish_Jain,

Starting from SonarQube v10.4, the sonar scanner requires a minimum version of Java 17 to run the analysis,

> **[Release upgrade notes](https://docs.sonarsource.com/sonarqube/10.4/setup-and-upgrade/release-upgrade-notes/)**
>
> List of release upgrade notes for SonarQube.

> **[Scanner environment | SonarQube Docs](https://docs.sonarsource.com/sonarqube/latest/analyzing-source-code/scanners/general-requirements/)**
>
> This page describes requirements or recommendations regarding the machine running the scanner and the actions you may need to take in order to meet them.

Does the agent/machine where you are running the analysis also have Java 17? Because the 4th line of the log says it still uses Java 11(Maybe it’s using the old cache?).  
Also, this might be a good time to review and upgrade your sonar-scanner package to the latest available version - [SonarScanner CLI](https://docs.sonarsource.com/sonarqube/latest/analyzing-source-code/scanners/sonarscanner/)

Thanks,  
Aravind

---

<div class="post-metadata">

**Author:** ![Tanish\_Jain](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/tanish_jain/32/57989_2.png) [@Tanish\_Jain](https://community.sonarsource.com/u/Tanish_Jain)\
**Post date:** [July 8, 2024, 6:51am UTC](https://community.sonarsource.com/t/getting-java-lang-unsupportedclassversionerror/118557/3 "2024-07-08T06:51:45Z")

</div>

Thanks for the suggestion. It works Now the above error has gone.  
I’m using this image- **sonarsource/sonar-scanner-cli:10.0**. But after running the sonar checks I’m getting this error. Can you suggest here what to do?

 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/d/e/de4d4c2f0be5c321d87ad444124415f5475fb22f.png)

---

<div class="post-metadata">

**Author:** ![Tanish\_Jain](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/tanish_jain/32/57989_2.png) [@Tanish\_Jain](https://community.sonarsource.com/u/Tanish_Jain)\
**Post date:** [July 8, 2024, 7:10am UTC](https://community.sonarsource.com/t/getting-java-lang-unsupportedclassversionerror/118557/4 "2024-07-08T07:10:41Z")

</div>

I’m also getting this error in my Sonarqube Pod-

 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/e/c/ec621ca1f901eceab21879b2b0148ad95872fe3c.png)
