Sonar Scanner's Embedded JRE is not recognized

Hi Team,
I’m currently using SonarQube Community Edition 8.6 standalone instance and sonar scanner cli version is 4.5.0.2216-linux.
I’m trying to integrate sonarqube in my existing bitbucket pipeline.

When executing sonarqube build task in bitbucket cloud build environment, sonar scanner was not able to recognize the embedded JRE.

I tried setting the JAVA_HOME & Path explicitly in the build task, after this in my local environment (using sonar scanner sonar-scanner-4.5.0.2216-macosx), when i run the task, embedded JRE is recognized and necessary scanning happens as expected. But still the execution fails in bitbucket pipeline execution.

Error Logs for your reference,

– JAVA_HOME : /opt/atlassian/pipelines/agent/build/src/bitbucket.org/my-project/sonar-scanner-4.5.0.2216-linux/jre
– PATH : /opt/atlassian/pipelines/agent/build/src/bitbucket.org/my-project/sonar-scanner-4.5.0.2216-linux/jre:/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
/bin/sh: java: not found
sonar-scanner-4.5.0.2216-linux/bin/sonar-scanner: exec: line 66: /opt/atlassian/pipelines/agent/build/src/bitbucket.org/my-project/sonar-scanner-4.5.0.2216-linux/jre/bin/java: not found

Can someone help me in fixing this?