I have Jenkins and Sonar running in separate Docker containers. I want to run the Sonar analysis in a Jenkins job, so I installed the "SonarQube Scanner for Jenkins" plugin.
This is the job configuration:

I'm getting this error when I run the build:
[run-sonar] $ /var/jenkins_home/tools/hudson.plugins.sonar.SonarRunnerInstallation/my_SonarScanner/bin/sonar-scanner -e -Dsonar.host.url=http://localhost:9000 -Dsonar.projectBaseDir=/var/jenkins_home/workspace/run-sonar
/var/jenkins_home/tools/hudson.plugins.sonar.SonarRunnerInstallation/my_SonarScanner/bin/sonar-scanner: exec: line 73: /var/jenkins_home/tools/hudson.model.JDK/java8/bin/java: not found
ERROR: SonarQube scanner exited with non-zero code: 127
Finished: FAILURE
Java8 was installed by Jenkins when the job ran for the first time. If I log in to the Jenkins container and cd to that folder, it exists.