We have installed a private build server for Azure DevOps. We use SonarCloud build tasks. Run the code Run Code Analysis task is run, I get the following errors. JAVA_HOME is defined and the path has %JAVA_HOME%\bin in it.
[command]C:\agent_work_tasks\SonarCloudPrepare_14d9cde6-c1da-4d55-aa01-2965cd301255\1.7.0\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe end
SonarScanner for MSBuild 4.6.2
Using the .NET Framework version of the Scanner for MSBuild
Post-processing started.
13:23:34.173 13:23:34.173 WARNING: Failed to find the code coverage command line tool. Possible cause: Visual Studio is not installed, or the installed version does not support code coverage.
WARNING: File āC:\agent_work\1\s\EnrollmentServices\Properties\PublishProfiles\InternalServices-UAT - FTP.pubxmlā does not exist.
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]13:23:34.564 Post-processing failed. Exit code: 1
13:23:34.564 Post-processing failed. Exit code: 1
##[error]C:\agent_work_tasks\SonarCloudPrepare_14d9cde6-c1da-4d55-aa01-2965cd301255\1.7.0\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe failed with return code: 1
##[section]Finishing: Run Code Analysis