Integrating Gradle code (Java 8 ) with Sonar 9

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension) - Sonarqube Developer Edition 9
  • what are you trying to achieve - Interating Sonarqube 9 with Azure devops pipeline for gradle code using Java 8 (I know java 8 is not supported)
  • what have you tried so far to achieve this -
  1. With Java 8, sonar is failing with error message: : “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”
  2. We integrated the code with Java 11. In that case the Gradle Build is failing with error message: “ Execution failed for task ‘:compileJava’”. Since our code is compatible with Java 8 only
  3. As per Sonarqube documentation: [Moving Analysis to Java 11 | SonarQube Docs], “If you are running your build with a Microsoft-hosted agent, this is already automatically done, and you’re all set.” This is not happening .

Hello @Adhiraj19,

As far as I can see this thread is almost a duplication of this one. I will close that one and continue the discussion in this thread.

As for your question. We indeed require analysis to be run on Java 11. While you still can use Java 8 to build your project. Could you please share with us your logs, build.gradle file and azure configuration?

Meanwhile, please try adding -x compile to your sonarqube task execution and share the results of this command using Java 11.

Regards,
Margarita