# SonarScanner, Java Runtime Error

**URL:** <https://community.sonarsource.com/t/sonarscanner-java-runtime-error/112290>\
**Category:** SonarQube Server / Community Build\
**Tags:** scanner, java\
**Created:** [March 28, 2024, 4:56pm UTC](https://community.sonarsource.com/t/sonarscanner-java-runtime-error/112290 "2024-03-28T16:56:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gamadmin](https://avatars.discourse-cdn.com/v4/letter/g/59ef9b/32.png) [@gamadmin](https://community.sonarsource.com/u/gamadmin)\
**Post date:** [March 28, 2024, 4:56pm UTC](https://community.sonarsource.com/t/sonarscanner-java-runtime-error/112290/1 "2024-03-28T16:56:45Z")

</div>

Sonarqube version: 10.4.1 ((build 88267)  
Sonar Scanner version: 4.5.0.2216  
SonarQube deployed: Docker

Trying to run the sonar scanner script to our project but the below error is showing up:

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

Checked the sonar scanner and it is still using the java 11  
INFO: SonarScanner 4.5.0.2216  
INFO: Java 11.0.3 AdoptOpenJDK (64-bit)

But we have the below java version in our CentOS 7 VM:  
java --version  
java 17.0.6 2023-01-17 LTS

How can we update the java path for the sonarscanner?

We’ve tried to modify the file /opt/sonar-scanner-4.5.0.2216-linux/conf/sonar-scanner.properties  
and add the JAVA\_HOME variable in it but still didn’t work.

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [March 29, 2024, 3:41pm UTC](https://community.sonarsource.com/t/sonarscanner-java-runtime-error/112290/2 "2024-03-29T15:41:33Z")

</div>

Hi,

> [@gamadmin](#):
>
> Sonar Scanner version: 4.5.0.2216  
> …  
> But we have the below java version in our CentOS 7 VM:  
> java --version  
> java 17.0.6 2023-01-17 LTS

Your scanner version is rather old at this point, and given that your installed Java version is 17, I suspect your scanner install is one with a bundled JVM.

[Upgrade the scanner](https://docs.sonarsource.com/sonarqube/latest/analyzing-source-code/scanners/sonarscanner/) and you should be good.

&nbsp;  
HTH,  
Ann

---

<div class="post-metadata">

**Author:** ![JohanFire](https://avatars.discourse-cdn.com/v4/letter/j/e8c25b/32.png) [@JohanFire](https://community.sonarsource.com/u/JohanFire)\
**Post date:** [December 4, 2024, 4:12am UTC](https://community.sonarsource.com/t/sonarscanner-java-runtime-error/112290/3 "2024-12-04T04:12:35Z")

</div>

hi, did you managed to fix this?

---

<div class="post-metadata">

**Author:** ![gamadmin](https://avatars.discourse-cdn.com/v4/letter/g/59ef9b/32.png) [@gamadmin](https://community.sonarsource.com/u/gamadmin)\
**Post date:** [December 4, 2024, 3:33pm UTC](https://community.sonarsource.com/t/sonarscanner-java-runtime-error/112290/4 "2024-12-04T15:33:42Z")

</div>

Hi Johan,

We haven’t tested this yet.

Thanks!
