Running SonarQube 9.4 with Azure DevOps project, trying to analyze a gradle (Android) project on MS hosted agent (mac-latest)
I am getting a
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':sonarqube'.
> org/sonar/batch/bootstrapper/EnvironmentInformation has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
I saw the documentation regarding Project specific SDK and tried to apply this, but unsuccessfully.
The setup:
Azure Pipeline:
- Sonar Prepare with extra option “sonar.java.jdkHome=$(JAVA_HOME_8_X64)” which should point to the JAVA 8 installation of MS hosted agents from what I found.
- Gradle build with enabled option “Run SonarQube or SonarCloud Analysis”
- Sonar Publish step
Failing on gradle build due to above error. Shouldn’t the sonar.java.jdkHome option fix this issue? I tried without it before but adding it didn’t make any difference.
How do I run this successfully?