java.lang.UnsupportedClassVersionError

hi,
i m getting below error , while trying to execute the .bat file wth command propmpt

sonarqube version - sonarqube-9.0.0.45539

WrapperSimpleApp: Unable to locate the class org.sonar.application.App: java.lang.UnsupportedClassVersionError: org/sonar/application/App 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

1 Like

Hello @nahyannv and welcome to the community :wave:

i assume that you are trying to run SQ with java 8 (class file version 52) , but we require java 11 (class file version 55) to run as stated in our documentation. try it again with java 11 :slight_smile:

Thank you tobias, i have updated with java 11 , now my new issue is with ,while running below command i am getting the error
SonarScanner.MSBuild.exe begin /k:“TellalPD” /d:sonar.host.url=“http://localhost:9000” /d:sonar.login=“c323eec2aa384b078fbf6c1d674799267b828869”

Error: C:\TFS2017\TELLAL_PDV2>SonarScanner.MSBuild.exe begin /k:“TellalPD” /d:sonar.host.url=“http://localhost:9000” /d:sonar.login=“c323eec2aa384b078fbf6c1d674799267b828869”
SonarScanner for MSBuild 5.2.1
Using the .NET Framework version of the Scanner for MSBuild
Pre-processing started.
Preparing working directories…
15:45:36.03 Updating build integration targets…
15:45:36.177 Your SonarQube instance seems to have an invalid license. Please check it. Server url : http://localhost:9000
15:45:36.177 Pre-processing failed. Exit code: 1

Appreciate if you could help

hmm looks like you are trying to use a commercial edition of sonarqube without a valid license. you can request a trial licence on the sonarqube homepage here

i downloaded developer edition, is there any easy way to change/modify the license, received the url from sonarqube account executive

You can set the License in the admin interface of Sonarqube. please note that a change to the server ID (like changing the database URI) will render the license invalid

Hi,

I have received license key also, but still it is giving me below error

image001.png

Sonarscanner.msbuild.exe is not recognized

I am not able to find above specified file in install directory

Hi @nahyannv ,

this is another error unrelated to the startup of sonarqube. it would be great if you could stick to one issue per thread (as stated in our FAQ) so things don’t get mixed up when finding a solution.

regarding the scanner not being found it seems like you simply did not install it or did not make it’s location known to the environment. this documentation here should help you

Hi Tobias,

I have Java 8, Java SE Development Kit 11, and Java SE Development Kit 16 installed on my computer.

Java installed

When I go to C:…\sonarqube\bin\windows-x86-64 and run StartSonar, it give me the following message before terminating. I can’t get it to run. What can be the issue? Do I need to configure something somewhere?

wrapper | → Wrapper Started as Console
wrapper | Launching a JVM…
jvm 1 | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
jvm 1 | Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
jvm 1 |
jvm 1 | WrapperSimpleApp: Unable to locate the class org.sonar.application.App: java.lang.UnsupportedClassVersionError: org/sonar/application/App 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
jvm 1 |
jvm 1 | WrapperSimpleApp Usage:
jvm 1 | java org.tanukisoftware.wrapper.WrapperSimpleApp {app_class} [app_arguments]
jvm 1 |
jvm 1 | Where:
jvm 1 | app_class: The fully qualified class name of the application to run.
jvm 1 | app_arguments: The arguments that would normally be passed to the
jvm 1 | application.
wrapper | ← Wrapper Stopped
Press any key to continue . . .

===============================================================
Update 13 August 2021: issue fixed.

I went to \sonarqube\conf\wrapper and edited Line 4:

# Path to JVM executable. By default it must be available in PATH.
# Can be an absolute path, for example:
#wrapper.java.command=/path/to/my/jdk/bin/java
wrapper.java.command=C:\Program Files\Java\jdk-11.0.12\bin\java

2 Likes

I encounter the same exception:

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

We are in the proces of installing and configuring SonarQube, after purchasing a developer license. We pulled the sonarqube:developer docker image from the hub (which is version 9.0) and after starting SonarQube and integrate SonarQube within our Azure DevOps (On Premise TFS 2017 V3, which is supported) within our build pipeline, using the SonarQube extension, it fails on the Run Code Analysis task.

Stepping into the running sonarqube container and execute java -version command: I see JDK 11. So a strange message.

Today, we re-created SonarQube, but now with sonarqube:lts-community (a new license needs to be generated, because of the new Server ID). So this is the 8.9 LTS, and from this version, everything works fine.

Kind regards,
Patrick

1 Like

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