Set java v17 during SonarScanner for .NET execution

Hello, I just upgraded SonarQube to v9.7(was 8.9) , I’m using the SonarScanner for .NET commands within an Azure DevOps hosted-agent CLI task to scan the application’s .sln file.
As per the latest version, SonarScanners only work with Java 11 or 17, I installed Java 17 as the agent is running 1.8, and cannot change the agent’s “JAVA_HOME” . I added the below line as part of the dotnet commands:

$env:JAVA_HOME=“C:/Program Files/Java/jdk-17”

But, it still gives me the attached error, any suggestions to fix the issue?

Hey there.

This error doesn’t have anything to do with the version of Java used, so for now I would leave that to the side.

How is your build configured (for example, if you have an azure-pipelines.yml file to share)? Have you checked that each of the ‘possible causes’ in the error message are not affecting your build?

Hi Colin, please close this case I opened a new topic with more details