I’m currently using SonarQube Community Edition 8.6 standalone instance and sonar scanner cli version is 18.104.22.1686-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-22.214.171.1246-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-126.96.36.1996-linux/jre
– PATH : /opt/atlassian/pipelines/agent/build/src/bitbucket.org/my-project/sonar-scanner-188.8.131.526-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-184.108.40.2066-linux/bin/sonar-scanner: exec: line 66: /opt/atlassian/pipelines/agent/build/src/bitbucket.org/my-project/sonar-scanner-220.127.116.116-linux/jre/bin/java: not found
Can someone help me in fixing this?