Wrong Java Version?

I am running SonarQube - Developer Edition - Version 9.1.0 (build 47736)

Sonarqube starts fine, but when I try to run a code analysis from Azure DevOps, I get the following error:

##[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

Searching, it looks like the problem is that my installed version of Java is too old. But the Requirements page says that what I need is Oracle JRE 11 or OpenJDK 11.

Which is what I have (OpenJDK 11).

From the command line:

> java --version
openjdk 11.0.13 2021-10-19
OpenJDK Runtime Environment 18.9 (build 11.0.13+8)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.13+8, mixed

From the Administration/System page:

java.version 11.0.13

What am I missing?

According to this list class version 52 is java 8 and version 55 is java 11.

It means that Java 8 has slipped in somewhere. In other words, the analysis is run by Java 8.
Check your PATH, JAVA_HOME etc.

@Porter I’m seeing the exact same issue on my side. I’ve double and triple checked my app server and Java 8 is no where to be found. The sonar system page also states its using Java 11.

Have you found anything?

@ninocapo , yes.

I turned out that while I only have Java 11 on my SonarQube server, the computer doing the scanning had Java 8.

I upgraded its Java to 11 and the problem went away.

1 Like

Thanks @Porter ! Just found the same on my side.

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