# Error reported using SonarQube scanner in Jenkins

**URL:** <https://community.jenkins.io/t/error-reported-using-sonarqube-scanner-in-jenkins/24327>\
**Category:** Using Jenkins\
**Tags:** question\
**Created:** [December 5, 2024, 1:10am UTC](https://community.jenkins.io/t/error-reported-using-sonarqube-scanner-in-jenkins/24327 "2024-12-05T01:10:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Msxixi](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/msxixi/32/11981_2.png) [@Msxixi](https://community.jenkins.io/u/Msxixi)\
**Post date:** [December 5, 2024, 1:10am UTC](https://community.jenkins.io/t/error-reported-using-sonarqube-scanner-in-jenkins/24327/1 "2024-12-05T01:10:36Z")

</div>

I wanted to integrate Jenkins with SonarQube, but after installing the plugin for sonar, I configured SonarQube server and started reporting errors saying java could not be found. I have configured both Sonarqube servers and SonarScanner installations. I really need help!!!

## **Error：** [dlwl] $ /var/lib/jenkins/tools/hudson.plugins.sonar.SonarRunnerInstallation/SonarQube/bin/sonar-scanner -Dsonar.host.url=[http://192.168.130.160:9000/](http://192.168.130.160:9000/) \*\*\*\*\*\*\*\* -Dsonar.projectBaseDir=/home/jenkins/workspace/大理文旅/前端/dlwl Could not find ‘java’ executable in JAVA\_HOME or PATH. WARN: Unable to locate ‘report-task.txt’ in the workspace. Did the SonarScanner succeed? ERROR: SonarQube scanner exited with non-zero code: 1 Finished: FAILURE **And I list my environment:** Jenkins: 2.479.2 OS: Linux - 3.10.0-1160.el7.x86\_64 Java: 17.0.8 - Oracle Corporation (Java HotSpot™ 64-Bit Server VM)

ace-editor:1.1  
ant:481.v7b\_09e538fcca  
antisamy-markup-formatter:162.v0e6ec0fcfcf6  
apache-httpcomponents-client-4-api:4.5.14-208.v438351942757  
asm-api:9.7.1-97.v4cc844130d97  
bootstrap5-api:5.3.2-3  
bouncycastle-api:2.30.1.78.1-248.ve27176eb\_46cb\_  
branch-api:2.1128.v717130d4f816  
build-timeout:1.33  
caffeine-api:3.1.8-133.v17b\_1ff2e0599  
checks-api:2.0.2  
cloudbees-folder:6.858.v898218f3609d  
command-launcher:107.v773860566e2e  
commons-lang3-api:3.17.0-84.vb\_b\_938040b\_078  
commons-text-api:1.11.0-108.v2c41b\_8b\_2b\_269  
config-file-provider:980.v88956a\_a\_5d6a\_d  
credentials:1389.vd7a\_b\_f5fa\_50a\_2  
credentials-binding:681.vf91669a\_32e45  
display-url-api:2.204.vf6fddd8a\_8b\_e9  
durable-task:568.v8fb\_5c57e8417  
echarts-api:5.4.0-7  
email-ext:2.91  
font-awesome-api:6.5.1-2  
git:5.2.1  
git-client:4.7.0  
github:1.35.0  
github-api:1.303-400.v35c2d8258028  
github-branch-source:1695.v88de84e9f6b\_9  
gitlab-plugin:1.8.0  
gradle:1.39.4  
gson-api:2.10.1-15.v0d99f670e0a\_7  
handlebars:3.0.8  
instance-identity:201.vd2a\_b\_5a\_468a\_a\_6  
ionicons-api:74.v93d5eb\_813d5f  
jackson2-api:2.17.0-379.v02de8ec9f64c  
jakarta-activation-api:2.1.3-1  
jakarta-mail-api:2.1.3-1  
javadoc:243.vb\_b\_503b\_b\_45537  
javax-activation-api:1.2.0-7  
javax-mail-api:1.6.2-10  
jaxb:2.3.9-1  
jdk-tool:73.vddf737284550  
jersey2-api:2.44-151.v6df377fff741  
jjwt-api:0.11.5-77.v646c772fddb\_0  
joda-time-api:2.12.7-29.v5a\_b\_e3a\_82269a\_  
jquery3-api:3.7.1-1  
jsch:0.2.16-86.v42e010d9484b\_  
json-api:20240303-41.v94e11e6de726  
json-path-api:2.9.0-118.v7f23ed82a\_8b\_8  
junit:1309.v0078b\_fecd6ed  
ldap:725.v3cb\_b\_711b\_1a\_ef  
localization-support:1.2  
localization-zh-cn:371.v23851f835d6b\_  
mailer:470.vc91f60c5d8e2  
mapdb-api:1.0.9-40.v58107308b\_7a\_7  
matrix-auth:3.2.2  
matrix-project:822.824.v14451b\_c0fd42  
mina-sshd-api-common:2.12.1-101.v85b\_e08b\_780dd  
mina-sshd-api-core:2.12.1-101.v85b\_e08b\_780dd  
momentjs:1.1.1  
nodejs:1.6.2  
okhttp-api:4.11.0-172.vda\_da\_1feeb\_c6e  
pam-auth:1.11  
pipeline-build-step:540.vb\_e8849e1a\_b\_d8  
pipeline-github-lib:38.v445716ea\_edda\_  
pipeline-graph-analysis:195.v5812d95a\_a\_2f9  
pipeline-groovy-lib:612.v84da\_9c54906d  
pipeline-input-step:449.v77f0e8b\_845c4  
pipeline-maven:1396.veb\_f07b\_2fc1d8  
pipeline-maven-api:1419.v89b\_ec7a\_c8b\_c5  
pipeline-milestone-step:101.vd572fef9d926  
pipeline-model-api:2.2114.v2654ca\_721309  
pipeline-model-definition:2.2114.v2654ca\_721309  
pipeline-model-extensions:2.2114.v2654ca\_721309  
pipeline-rest-api:2.24  
pipeline-stage-step:296.v5f6908f017a\_5  
pipeline-stage-tags-metadata:2.2114.v2654ca\_721309  
pipeline-stage-view:2.24  
plain-credentials:183.va\_de8f1dd5a\_2b\_  
plugin-util-api:3.8.0  
popper2-api:2.11.6-5  
resource-disposer:0.24  
scm-api:698.v8e3b\_c788f0a\_6  
script-security:1369.v9b\_98a\_4e95b\_2d  
snakeyaml-api:2.3-123.v13484c65210a\_  
sonar:2.17.3  
ssh-credentials:337.v395d2403ccd4  
ssh-slaves:2.846.v1b\_70190624f5  
sshd:3.322.v159e91f6a\_550  
structs:338.v848422169819  
subversion:2.16.0  
timestamper:1.20  
token-macro:400.v35420b\_922dcb\_  
trilead-api:2.142.v748523a\_76693  
variant:60.v7290fc0eb\_b\_cd  
workflow-aggregator:590.v6a\_d052e5a\_a\_b\_5  
workflow-api:1336.vee415d95c521  
workflow-basic-steps:994.vd57e3ca\_46d24  
workflow-cps:2759.v87459c4eea\_ca\_  
workflow-durable-task-step:1199.v02b\_9244f8064  
workflow-job:1385.vb\_58b\_86ea\_fff1  
workflow-multibranch:716.vc692a\_e52371b\_  
workflow-scm-step:427.v4ca\_6512e7df1  
workflow-step-api:678.v3ee58b\_469476  
workflow-support:936.v9fa\_77211ca\_e1  
ws-cleanup:0.43

**I also checked the server, and I found I already installed plugins:**  
[root@localhost /root]$ls /var/lib/jenkins/tools/hudson.plugins.sonar.SonarRunnerInstallation/  
\_ SonarQube  
[root@localhost /root]ls /var/lib/jenkins/tools/hudson.plugins.sonar.SonarRunnerInstallation/SonarQube/bin/ sonar-scanner sonar-scanner.bat sonar-scanner-debug sonar-scanner-debug.bat [root@localhost /root]/var/lib/jenkins/tools/hudson.plugins.sonar.SonarRunnerInstallation/SonarQube/bin/sonar-scanner --version  
09:13:41.872 INFO Scanner configuration file: /var/lib/jenkins/tools/hudson.plugins.sonar.SonarRunnerInstallation/SonarQube/conf/sonar-scanner.properties  
09:13:41.875 INFO Project root configuration file: NONE  
09:13:41.886 INFO SonarScanner CLI 6.2.1.4610  
09:13:41.887 INFO Java 17.0.8 Oracle Corporation (64-bit)  
09:13:41.888 INFO Linux 3.10.0-1160.el7.x86\_64 amd64

---

<div class="post-metadata">

**Author:** ![anthony-chu](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/anthony-chu/32/7528_2.png) [@anthony-chu](https://community.jenkins.io/u/anthony-chu)\
**Post date:** [February 5, 2025, 1:01am UTC](https://community.jenkins.io/t/error-reported-using-sonarqube-scanner-in-jenkins/24327/2 "2025-02-05T01:01:04Z")

</div>

@Msxixi Where is the SonarQube scanner being called from? Is it from a pipeline/job that’s being executed in an agent?
