Met has been compiled by a more recent version of the Java Runtime (class file version 61.0) Issue

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    1. sonar-qube-gradle plugin
      id "org.sonarqube" version "4.4.1.3373"
    2. JDK11: azul-11.0.24
  • how is SonarQube deployed: zip, Docker, Helm
    Run by Shell In Local.
  • what are you trying to achieve
    ./gradlew build sonarqube
  • what have you tried so far to achieve this
    Met this issue :
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

Tried to clean cache:
./gradlew clean && rm -dfr ~/.sonar/*
Export JAVA_HOME
export JAVA_HOME=/Users/UserA/Library/Java/JavaVirtualMachines/azul-11.0.24/Contents/Home
But still met this issue.

Below is my gradle configuration. Looking forward to your response. :pray:Thanks!
BTW: My project could only use JDK11.

plugins {
    id 'org.springframework.boot' version '2.7.14'
    id 'jacoco'
    id "org.sonarqube" version "4.4.1.3373"
}

sonarqube {
    properties {
        property "sonar.projectKey", "<projectKey>"
        property "sonar.organization", "<organization>"
        property "sonar.host.url", "https://sonarcloud.io"
    }
}

Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!

Hey there.

Even if your project uses Java 11, you have to use Java 17 to execute the scanner. More information is available in these docs.

The requirement on the Java runtime environment refers only to the version of Java used by the scanner itself to run. It does not restrict the versions of Java that can be analyzed by the scanner. In addition, the required version changes with successive versions of the scanner.

Ye, fixed the issue by the Post.

Have another question that, cloud the sonarqube-plugin add comments at Pull Request of Github?

I’m sorry, I don’t understand the question.

OKay.

I want to integrate the Sonarqube with the Pull Request Analysis.
But met this error when running at Github Actions.

* What went wrong:
Execution failed for task ':sonarqube'.

[169](https://github.com/<repo>/<project>/actions/runs/11718238607/job/32330550849?pr=1136#step:16:170)> Could not find the pullrequest with key '1146'

I checked found found the PR 1146 : https://github.com/repo/project/pull/1146 exists.
So very confused about this error.

This typically means the project isn’t bound to the right repo (the same repo the PR is coming from). Can you check?

I don’t have the repo admin access. Before I request the admin to do this.
Could I provide the organization and project key with you then you help to check this? THX :pray:

Hey there.

I don’t have access to your SonarCloud organization! You’ll need to consult internally.

Thx Colin, it’s fixed. Have another question:
If I have one gradle project have three sub-projects:

  1. subproject-A
  2. subproject-B
  3. subproject-C
    And I start three Github Actions Job to run them separately(It’s one Job run one subproject).
    Then how can I run the Sonarqube?

Feel free to raise a new thread.

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