SonarScanner will require Java 17 to run

Hi,

in SonarQube dashboard I see this warning message, even in our clients(where sonarscanner runs) java version is 17. When I run the “java --version” on command prompt, it gives the output that I shared below as figure. How can I fix this warning message? I am wondering why sonar scanner doesn’t use System Variables, as it logs Java version 11(you can see below)

Warning Message on Dashboard:
SonarScanner will require Java 17 to run, starting in SonarQube 10.3. Please upgrade the version of Java that executes the scanner and refer to the documentation if needed.

Java version in clients(where sonarscanner runs):
java_version

SonarQube version :
10.2

Some sonarscanner logs might be useful :
INFO: SonarScanner 4.6.0.2311
INFO: Java 11.0.3 AdoptOpenJDK (64-bit)
INFO: Windows Server 2016 10.0 amd64

Code Language :
C/C++

1 Like

Hi,

Welcome to the community!

Can you check the value of $JAVA_HOME on your build agent?

 
Thx,
Ann

Hi @ganncamp,
Thanks for the welcoming! happy to be here

I checked the value in Windows agents by using the command below,

echo %JAVA_HOME%

It gives the output:
image

BRs

Hi,

Looking again at your scanner version, it’s a bit old. And Java 11 was our standard when it was released.

I’m going to guess you installed a scanner with an embedded (Java 11) JVM. Upgrade to the latest version and see if that works for you.

 
HTH,
Ann

1 Like

Hi @ganncamp ,

Yes, as you mentioned it happened because of the old version of sonar scanner. Updated it accordingly and that warning message is gone. In sonar scanner logs, I am also able to see the java version 17 is used as expected. Thanks a lot

last one thing, is there any table that shows the compliant versions between Sonar Server, Scanner, Build wrapper etc? Or it can be checked in the latest document individually

BRs

1 Like

Hi,

I’m glad you solved it!

We don’t have a compatibility table. Generally, scanner versions are backward compatible, but it’s always good to be on the latest. For the build-wrapper, you should be on the version that corresponds to your SonarQube release. That makes it good practice to re-download the build-wrapper from your SonarQube instance on a regular basis. For some people that’s part of the build script.

 
HTH,
Ann

that’s make sense :slight_smile:

thanks for the prompt responses and I will consider this case as closed from my side.

BRs

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.