Jenkins build fails to run the SonarQube scanner

I am using the following versions of software

  • SonarQube (developer edition)
  • SonarScanner
  • Jenkins GitHub Branch Source Plugin 2.9.1
  • SonarQube Scanner for Jenkins 2.12

I am trying to set up scanning of my GitHub repository on push and PR using Jenkins. Everything seems to be set up according to the instructions that popped up in SonarQube after I created a project from GitHub repo.

Jenkins build step “SonarQube Analysis” keeps failing and there is nothing logged from the console. I also noticed there is nothing new in the SonarQube logs. Is there something I missed? Can you please suggest what might me wrong?

I’ve attached my Jenkins file for reference.
Jenkinsfile.txt (205 Bytes)


There’s really nothing in your Jenkins log?

Have you checked out the docs on using a Jenkins pipeline? The sample code there doesn’t look like yours…


Hi @ganncamp,

there is absolutely nothing in the sonarqube and elasticsearch logs.

My code is a little different from your docs. I followed in instructions in SonarQube. Screenshots attached below. Is something missing in the instructions?

Hi @ganncamp,

same new logs appeared in Jenkins:

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

I have Java JRE and JDK installed on the system. I restarted Jenkins just in case it needed to pick up the JAVA_HOME variable from the system, but there’s no change.

I can see JAVA_HOME being set in the SSH console:

root@ubuntu-s-4vcpu-8gb-ams3-01:~# echo $JAVA_HOME

It is also configured in Jenkins settings. What would you advise?


I’d go back to the basics. Start by having your pipeline echo/print out the current values for $JAVA_HOME and $PATH.