I seem to be unable to run the prepare step on our self hosted (Windows) VM:
- ALM used: Azure DevOps
- CI system used: Azure DevOps
- Scanner command used when applicable (private details masked)
- Languages of the repository: C#
- Error observed: 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
- Steps to reproduce
- Potential workaround: Use MS Hosted build agent
When using a self hosted build agent running on a Windows VM, the prepare step fails with the above error. The VM has the latest Java RE (Oracle 1.8.0_333). Running the job on a MS Hosted agent works fine.
Information form the failing job:
Calling the SonarScanner CLI…
INFO: Scanner configuration file: C:\DevOps\Agent02_work_tasks\SonarCloudPrepare_14d9cde6-c1da-4d55-aa01-2965cd301255\1.27.0\classic-sonar-scanner-msbuild\sonar-scanner-4.6.2.2472\bin..\conf\sonar-scanner.properties
INFO: Project root configuration file: C:\DevOps\Agent02_work\6.sonarqube\out\sonar-project.properties
INFO: SonarScanner 4.6.2.2472
INFO: Java 1.8.0_333 Oracle Corporation (64-bit)
INFO: Windows Server 2019 10.0 amd64
INFO: User cache: C:\Windows\system32\config\systemprofile.sonar\cache
INFO: Scanner configuration file: C:\DevOps\Agent02_work_tasks\SonarCloudPrepare_14d9cde6-c1da-4d55-aa01-2965cd301255\1.27.0\classic-sonar-scanner-msbuild\sonar-scanner-4.6.2.2472\bin..\conf\sonar-scanner.properties
INFO: Project root configuration file: C:\DevOps\Agent02_work\6.sonarqube\out\sonar-project.properties
INFO: Analyzing on SonarCloud
INFO: Default locale: “en_US”, source code encoding: “windows-1252” (analysis is platform dependent)
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 2.348s
INFO: Final Memory: 6M/123M
INFO: ------------------------------------------------------------------------
##[error]ERROR: Error during SonarScanner execution
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
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
What can I do to have a succesful pipeline on a self hosted agent?