SonarCloudAnalyze failed for java project

I would like to add sonarCloud to my java project. I got the error :Your project contains .java files, please provide compiled classes with sonar.java.binaries property, or exclude them from the analysis with sonar.exclusions property.

I was searching this issue a lot and I knew to solve it, I should add sonar.java.binaries to my sonarCloud (Java | SonarQube Docs). Even I added it, I still get the error. Please help me.

this is my .yml file

and this is my error:

Hi @saeedeh.masoumi ,

Welcome to SonarSource Community! :sonarsource:

It looks like your Java version is still not set correctly for SonarCloud analysis. Please try setting sonar.java.jdkHome as defined in Java | SonarCloud documentation as part of the extraProperties key and see if that works for you.

Joe

Thanks Joe for your quick response. I did a silly mistake, that’s why sonar analysis was failed.
I put colon instead of equal for sonar.java.binaries and for sonar.java.jdkHome, I assigned string value. so I changed it to this and it works :slightly_smiling_face:

image

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.