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.
SonarScanner for MSBuild 4.6.2
Using the .NET Framework version of the Scanner for MSBuild
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