Java 1.8.0 support

When running our projects in sonarcloud.io a new warning has appeared:
“The version of Java (1.8.0_272) you have used to run this analysis is deprecated and we will stop accepting it accepting it soon.Please update to at least Java 11.”
We use maven to build the project and wrap the maven tasks with the sonarcloud CLI.

Does this mean that soon we will not be able scan our projects if we continue using Java1.8.0 for the build process?

Also, the release notes say that the change would take effect by October, however we are still able to run the scans using Java 1.8.0, when is the actual deadline date?

Kind Regards,
Angel.

Welcome to the community!

You can run the build and scan steps separately:

  • Step 1: build your project using Java 1.8, with unit tests, and generate test coverage reports
  • Step 2: run the sonar scanner using Java 11 or later with mvn org.sonarsource.scanner.maven:sonar-maven-plugin:sonar

As far as I know it’s not 100% decided yet, it’s expected to be in January.

Thanks for the quick reply, but I mixed projects. For this one we are using gradle, is it still possible to use the same approach?

I tried running “gradle build” first with java 8 and then “gradle sonarqube” with java 11 but it fails since “gradle sonarqube” tries to build the project which requires java 8.

Hi @acastro

I have looked into just executing the sonar task in Gradle with a different JDK version but so far have not been able to locate how this can be done.

I did find a new feature called Toolchains for JVM projects maybe this can be of use. I myself have not been able to test drive for a solution.

Cheers,
Mark

2 Likes