Hi
I have a build agent for azure devops, on windows 2023 with following jdk version :
But the “Run Code Analysis” fails :
2023-12-12T10:22:36.8164082Z ##[error]Exception in thread “main” java.lang.UnsupportedClassVersionError: org/sonarsource/scanner/cli/Main 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
it happens when “sonar-scanner.bat” called:
5.18.4\classic-sonar-scanner-msbuild\sonar-scanner-4.8.1.3023\bin\sonar-scanner.bat
But when I manually run the command inside the agent, it publish the results to the SonarQube server.
SonarScanner.MSBuild.exe begin /k:“project-key” /d:sonar.token=“myAuthenticationToken”
MSBuild.exe <path to project file or .sln file> /t:Rebuild
SonarScanner.MSBuild.exe end /d:sonar.token=“myAuthenticationToken”
Or when I run the “sonar-scanner.bat” manually in the agent command prompt it also succussed:
sonar-scanner version: 4.8.1.3023