I've been trying to configure sonarqube to work with cloud build trigger and want to use bitnami's sonarqube compute instance installation but when I installed sonar-scanner using this guide: https://docs.sonarqube.org/latest/analysis/scan/sonarscanner/ and when run sonar-scanner -h
I receive this Error "Could not find 'java' executable in JAVA_HOME or PATH" my JAVA_HOME is opt/bitnami/java and PATH is opt/bitnami/java/bin help me what I'm doing wrong or if missing something.
Bitnami developer here,
The following commands worked for me on a GCE instance:
Download solr-scanner 4.2.0:
Unzip it in /opt
:
sudo unzip -d /opt sonar-scanner-cli-*.zip
Download sonar-scanning-examples:
Unzip them in $HOME/sonar-scanning-examples
:
unzip -d $HOME master.zip
cd /home/bitnami/sonar-scanning-examples-master/sonarqube-scanner
/opt/sonar-scanner-*/bin/sonar-scanner -Dsonar.login=admin -Dsonar.password=PASSWORD
In case you face some issue, try to load the environment before analyzing the project:
sudo /opt/bitnami/use_sonarqube
I hope it helps