Sonar-Scanner 64bit linux, not picking up embedded JRE

Trying to invoke Sonar-Scanner on Ubuntu 20.03LTS while running from a TeamCity agent, and the Sonar-Scanner script doesnt pick up the embedded jre. Downloaded sonar-scanner-cli-, and the Sonar-Scanner set use_embedded_jre=true correctly. However keep getting:

Could not find 'java' executable in JAVA_HOME or PATH.

I’ve tried to download the sonar-scanner, unzipping it to the home directory and call it from TeamCity - this actually works. But when including sonar-scanner in the git repo and letting the TeamCity agent check it out, it doesnt.

Any advice on how to troubleshoot this?

Could you check if the user running the script has execute permission on <scaner-scanner-home>/jre/bin/java?