Problems with scanner after upgrading server from 9.9 to 10.4

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube=10.4.1, Scanner=, JRE=

We have been running the latest LTS version for while and have updated to 10.4.1 (latest as of writing this). Our newest runners with the latest scanner still works without problems but we have some old runners that are used for older releases which fails when starting the analysis.
We are using the runner supplied with the analyzer and it worked immediately before the update and failed afterwards.
I don’t understand why the analyzer would fail since it has access to the same JRE as before, which was even supplied with it. Does it download something from the server in the process?

INFO: Scanner configuration file: /opt/sonar-scanner-
INFO: Project root configuration file: /builds/wp-tuc/SICS/SICS/
INFO: SonarScanner
INFO: Java Eclipse Adoptium (64-bit)
INFO: Linux 5.15.0-89-generic amd64
INFO: User cache: /root/.sonar/cache
INFO: Scanner configuration file: /opt/sonar-scanner-
INFO: Project root configuration file: /builds/wp-tuc/SICS/SICS/
INFO: Analyzing on SonarQube server
INFO: Default locale: "en_US", source code encoding: "utf-8"
INFO: ------------------------------------------------------------------------
INFO: ------------------------------------------------------------------------
INFO: Total time: 2.290s
INFO: Final Memory: 4M/40M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
java.lang.UnsupportedClassVersionError: org/sonar/batch/bootstrapper/EnvironmentInformation 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
	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
	at java.base/java.lang.ClassLoader.defineClass(Unknown Source)
	at java.base/ Source)
	at java.base/ Source)
	at java.base/$ Source)
	at java.base/$ Source)
	at java.base/ Method)
	at java.base/ Source)
	at org.sonarsource.scanner.api.internal.IsolatedClassloader.loadClass(
	at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
	at org.sonarsource.scanner.api.internal.batch.DefaultBatchFactory.createBatch(
	at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(
	at com.sun.proxy.$Proxy0.execute(Unknown Source)
	at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(
	at org.sonarsource.scanner.api.EmbeddedScanner.execute(
	at org.sonarsource.scanner.cli.Main.execute(
	at org.sonarsource.scanner.cli.Main.execute(
	at org.sonarsource.scanner.cli.Main.main(
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.

Hey there.

This specific error comes when you’re running Java 11 with SonarQube v10.4.1

Release 10.4 upgrade notes

End of support of Java 11 as scanner environment

Java 11 is no longer supported as a scanner runtime environment. The minimum required version is Java 17. See Prerequisites and requirements for more information. (SONAR-21157)

v5.0+ of the scanner comes with Java 17 embedded, so I’d be really surprised if you get the same error when using v5.0.1.

Do you have logs to share from when you’re using Java 17 or the upgraded scanner?

Hi Colin.
When running with the new scanner there are no problems.
But out of curiosity: How does the old scanner suddenly require Java 17 after the upgrade? Is it due to something downloaded from the server?

Best regards

Yes. The scanner is ultimately just a way to bootstrap getting the files from the server that has all the logic. That’s where the dependency comes from.

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