Problem scenario
You are trying to set up SonarQube for the first time. You run this command:
bash /opt/sonarqube/bin/linux-x86-64/sonar.sh console
You see this error:
"jvm 1 | java.nio.file.AccessDeniedException: /opt/sonarqube/temp/conf/es/elasticsearch.yml"
What do you do?
Solution
Make sure that the user who is running the command has the ability to execute files in the /opt/sonarqube/ directory (or wherever the destination is that you are installing Sonarqube). You may want to run a command such as this:
sudo chown -R jdoe:goodgroup /opt/sonarqube
Replace jdoe with the username that is trying to run the command. Replace goodgroup with the group associated with the user. If you do not know what group that is, log in as that user or use "su jdoe" (where jdoe is the username). Then run the command "groups".
Then run these two commands:
sudo bash /opt/sonarqube/bin/linux-x86-64/sonar.sh stop
bash /opt/sonarqube/bin/linux-x86-64/sonar.sh console