Dotnet sonarscanner 5.2.2 on ubuntu 20.04.3 with .net 5 show error on end post-processing about java

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
  • how is SonarQube deployed: zip, Docker, Helm
  • what are you trying to achieve
  • what have you tried so far to achieve this

Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!
Qube 8.9.10 in docker
Scanner for .net msbuild 5.2.2 nuget global tool
.net 5
Ubuntu 20.04.3
Tried openjdk jre 11 and 17 headless package

I am trying command

~/project$ /usr/bin/dotnet sonarscanner end /d:sonar.login=“admin” /d:sonar.password=“user”

And got result

SonarScanner for MSBuild 5.2.2 Using the .NET Core version of the Scanner for MSBuild Post-processing started. Calling the SonarScanner CLI… Could not find ‘java’ executable in JAVA_HOME or PATH. The SonarScanner did not complete successfully 20:05:32.56 Post-processing failed. Exit code: 1

JAVA_HOME is /usr/bin/java

Why so? Please, help.

Hey there.

You’re using pretty old versions of both SonarQube and the Scanner for MSBuild / .NET.

Start by using some supported versions – specifically SonarQube v9.9.3 and the Scanner for .NET v6.0. Let us know if you still face an issue.