Could not find 'java'

I’m using CI/CD with docker runner and in my stage quality I have something like this:
stage: quality
- dotnet tool install dotnet-sonarscanner --global
- export PATH="$PATH:/root/.dotnet/tools"
- dotnet sonarscanner begin /k:“test-test” /“http://localhost:9000” /d:sonar.login=“project_token”
- dotnet build
- dotnet sonarscanner end /d:sonar.login=“project_token”

Everything works fine till last line:
$ dotnet sonarscanner end /d:sonar.login=“2623a3380ad41974d80e76606f55a510a7b6eaaf”
SonarScanner for MSBuild 5.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
Post-processing failed. Exit code: 1
Cleaning up file based variables
ERROR: Job failed: exit code 1

I have allready check my java -version:
openjdk version “1.8.0_262”
OpenJDK Runtime Environment (build 1.8.0_262-b10)
OpenJDK 64-Bit Server VM (build 25.262-b10, mixed mode)

Hey there.

Did you check your Java version in the context of your Docker container?