I used the current version of the sonar-scanner (22.214.171.1243) on linux.
What I encountered is that there is no parameter or environment variable to change the jre.
In older versions this was possible: https://stackoverflow.com/questions/39105537/sonarqube-scanner-use-non-default-java
If I check the source code (https://github.com/SonarSource/sonar-scanner-cli/blob/master/src/main/assembly/bin/sonar-scanner) I found a parameter “use_embedded_jre”, but on the delivered script the specific variable is hardcoded to true.
My workaround currently is to change the file manually (in a dockerfile…)
In the download page there are many different downloads:
The links named “64-bit” use a embedded JRE, the file from the “Any” link doesn’t (and it’s much smaller than the others). So just use this file.
Perfect, thank you!