Error running SonarCloudAnalyse step in Azure devops

  • ALM used:
    Azure DevOps Services
  • CI system used :
    Azure DevOps Services
  • Scanner command used when applicable (private details masked):
    Default ‘SonarCloudAnalyze’ command.
  • Languages of the repository:
    Node/Typescript
  • Error observed
ERROR: Error during SonarScanner execution
##[error]java.lang.UnsupportedClassVersionError: 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
	at java.lang.ClassLoader.defineClass1(Native Method)
  • Steps to reproduce
    Run pipeline. SonarCloudAnalyze is after build and tests steps.

  • Potential workaround
    None

Version info from dev-ops logs

INFO: SonarScanner 4.6.2.2472
INFO: Java 1.8.0_312 Private Build (64-bit)
INFO: Linux 5.4.0-1067-azure amd64

The error does seem self explanatory, in that it would appear the installed version of Java version is behind where it needs to be, but can’t see in the sonarcloud documentation what the minimum version required is. Also, not familiar with Java so could use some advice on what actually needs to be installed, and how best to get that on an azure build agent.

Thanks

Step header info

Starting: SonarCloudAnalyze
==============================================================================
Task         : Run Code Analysis
Description  : Run scanner and upload the results to the SonarCloud server.
Version      : 1.27.0
Author       : sonarsource
Help         : Version: 1.27.0. This task is not needed for Maven and Gradle projects since the scanner should be run as part of the build.

[More Information](https://sonarcloud.io/documentation/analysis/scan/sonarscanner-for-azure-devops/)
==============================================================================

Looks like we are using self hosted agents, I had thought we were using the MS standard agents. This runs fine when targeting ‘ubuntu-latest’ build agent that targets Java 11 as the default.

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