we are using this commands
dotnet tool update --global dotnet-sonarscanner --version 6.0.0
dotnet sonarscanner begin
dotnet sonarscanner end
and we are getting this error
Error: LinkageError occurred while loading main class org.sonarsource.scanner.cli.Main
java.lang.UnsupportedClassVersionError: org/sonarsource/scanner/cli/Main has been compiled by a more recent version of the Java Runtime (class file version 61), this version of the Java Runtime only recognizes class file versions up to 55.0
The SonarScanner did not complete successfully
I will try to delete all private info. But as I said this is running in a windows runner in our own vm with windows server. The pipeline is using the las version of atlassian but this especific part of the execution is running locally
Java 17 is required to run this version of the scanner. If you are running a previous version of Java, you will need a previous version of the scanner.
Looks like you are running the pipeline using atlassian/default-image:latest.
Installing a runtime on the agent host has no influence if the pipeline is running in a container.
You should check the java version installed in the docker image itself.
If you need SLAs, guaranteed response, privacy, SonarSource also offers Commercial Support.
I would suggest checking what version of java your JAVA_HOME variable is pointing to, and adjusting if it’s a distro other than Java 17+ (and @ArwynFr is right, you should avoid Java 18, since it’s EOL).
After a lot of reinstallment of java I get know this error
SonarScanner for MSBuild 6.1
3
Using the .NET Core version of the Scanner for MSBuild
4
Post-processing started.
5
14:02:37.563 14:02:37.563 WARNING: File 'C:\windows\temp\9d9e9ea6-23e7-5bb8-baa0-421a1e7d2b86\1707317664349\build\Fuentes\Cardinal.CPP\Cardinal.CPP.DTO\stylecop.json' does not exist.
6
Calling the SonarScanner CLI...
7
Error: LinkageError occurred while loading main class org.sonarsource.scanner.cli.Main
8
java.lang.UnsupportedClassVersionError: org/sonarsource/scanner/cli/Main has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0