Hi, as the title explains I’m having problems running the pipeline with .Net Core and SonarCloud
- ALM used : Azure DevOps
- CI system used: Azure DevOps
- Languages of the repository: C# .NET Core
pool: ‘Servers CI’
buildPlatform: ‘Any CPU’
displayName: ‘Install .NET Core SDK’
SonarCloud: ‘Sonarcloud SecCert’
displayName: ‘Build solution’
displayName: ‘Run SonarCloud analysis’
The error happens at the moment of running the task: SonarCloudAnalyze@1 and this is literally the result:
- 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 SonarScanner did not complete successfully
The SonarScanner did not complete successfully
##[error]18:51:48.442 Post-processing failed. Exit code: 1
18:51:48.442 Post-processing failed. Exit code: 1
##[error]The process ‘C:\Agente Azure_work_tasks\SonarCloudPrepare_14d9cde6-c1da-4d55-aa01-2965cd301255\1.20.0\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe’ failed with exit code 1
Finishing: Run SonarCloud analysis
The real problem is that JAVA is installed in the server used for the process (C:\Program Files\Java\jdk-16.0.1\bin) and the variables Path an JAVA_HOME are well explained into the system variables, and also into the capabilities of the agent.
Any suggestion will be appreciated.
Thanks in advance.