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!

[289](https://github.com/***/actions/runs/6803366198/job/18498546925#step:4:301)

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

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

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

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

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

[295](https://github.com/***/actions/runs/6803366198/job/18498546925#step:4:307)

[296](https://github.com/***/actions/runs/6803366198/job/18498546925#step:4:308)For more details see https://docs.gradle.org/6.9.3/release-notes.html

[297](https://github.com/***/actions/runs/6803366198/job/18498546925#step:4:309)

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

[301](https://github.com/***/actions/runs/6803366198/job/18498546925#step:4:313)

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

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



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

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

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

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

[309](https://github.com/**/**/actions/runs/6803366198/job/18498546925#step:4:321)

[310](https://github.com/**/**/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.