Build fails while executing “Run Code Analysis”
Pool: Azure Pipelines
Agent: Hosted Agent
Starting: Run Code Analysis
Task : Run Code Analysis
Description : Run scanner and upload the results to the SonarCloud server.
Version : 1.9.0
Author : sonarsource
Help : This task is not needed for Maven and Gradle projects since the scanner should be run as part of the build.
More Information
[command]D:\_work\_tasks\SonarCloudPrepare_14d9cde6-c1da-4d55-aa01-2965cd301255\1.9.0\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe end
SonarScanner for MSBuild 4.7.1
Using the .NET Framework version of the Scanner for MSBuild
Post-processing started.
Calling the SonarQube Scanner...
ERROR: JAVA_HOME not found in your environment, and no Java
executable present in the PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation, or add "java.exe" to the PATH
##[error]The SonarQube Scanner did not complete successfully
The SonarQube Scanner did not complete successfully
##[error]10:03:46.845 Post-processing failed. Exit code: 1
10:03:46.845 Post-processing failed. Exit code: 1
##[error]The process 'D:\_work\_tasks\SonarCloudPrepare_14d9cde6-c1da-4d55-aa01-2965cd301255\1.9.0\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe' failed with exit code 1
##[section]Finishing: Run Code Analysis