SonarCloud - Java 11 deprecation support

Template for a good new topic, formatted with Markdown:

  • ALM used (GitHub, Bitbucket Cloud, Azure DevOps) - GitHub
  • CI system used (Bitbucket Cloud, Azure DevOps, Travis CI, Circle CI - GitHub actions, Azure DevOps
  • Scanner command used when applicable (private details masked)
  • Languages of the repository - Java
  • Only if the SonarCloud project is public, the URL
    • And if you need help with pull request decoration, then the URL to the PR too
  • Error observed (wrap logs/code around with triple quotes ``` for proper formatting)
  • Steps to reproduce - we tried to follow the link - Scanner environment & SonarCloud for this Java 11 deprecation, as we have lot of projects in 11 we will not be able to immediately migrate to 17 so we would require a workaround to just update the sonar scanner version alone to 17
  • Potential workaround

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

Welcome to Gradle 6.9.3!


[290](***/actions/runs/6803366198/job/18498546925#step:4:302)Here are the highlights of this release:

[291](***/actions/runs/6803366198/job/18498546925#step:4:303) - This is a small backport release.

[292](***/actions/runs/6803366198/job/18498546925#step:4:304) - Java 16 can be used to compile when used with Java toolchains

[293](***/actions/runs/6803366198/job/18498546925#step:4:305) - Dynamic versions can be used within plugin declarations

[294](***/actions/runs/6803366198/job/18498546925#step:4:306) - Native support for Apple Silicon processors


[296](***/actions/runs/6803366198/job/18498546925#step:4:308)For more details see


[298](***/actions/runs/6803366198/job/18498546925#step:4:310)Starting a Gradle Daemon (subsequent builds will be faster)
FAILURE: Build failed with an exception.


[302](***/actions/runs/6803366198/job/18498546925#step:4:314)* Where:

[303](***/actions/runs/6803366198/job/18498546925#step:4:315)Settings file '/home/runner/work/***/***/settings.gradle'

[305](***/actions/runs/6803366198/job/18498546925#step:4:317)* What went wrong:

[306](***/actions/runs/6803366198/job/18498546925#step:4:318)Could not compile settings file '/home/runner/work/***/***/settings.gradle'.

[307](**/**/actions/runs/6803366198/job/18498546925#step:4:319)> startup failed:

[308](**/**/actions/runs/6803366198/job/18498546925#step:4:320) General error during semantic analysis: Unsupported class file major version 61


[310](**/**/actions/runs/6803366198/job/18498546925#step:4:322) java.lang.IllegalArgumentException: Unsupported class file major version 61

Hey there.

The workaround would be to compile with Java 11, and then run the analysis with Java 17.

As documented:

# Gradle
gradle build ...
export JAVA_HOME=/path/to/java17
gradle sonarqube ...

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