Running Sonar on AEM 6.5.17 where AEM supports Java 11 and Sonar expects minimum of Java 17

Hi there,
We have AEM Project which runs on java 11 and recently sonar cloud got updated to java 17 and it is no longer supports java 11
We have azure builds associated with Sonar cloud analysis with Builds that are getting failed due to the version miss match of java
AEM doesn’t support java 17
Did anyone have solution for the same ? Kindly suggest.

Hey there.

You just have to make sure that by the time analysis is happening, you’ve switched over to Java 17 (Java 17 doesn’t have to run your build). See the Scanner Environment for more details, and pay specific attention to the Maven/Gradle section (I assume you’re using one of them to build your code).

Hi,

On a mac, i have used Jenv to have different versions of Java running, so my project is using java 11, and then the sonarqube server is using java 17. Jenv allows you to sandbox a java version to a specific directory, which is what I have done.

This is just a high-level explanation. I am going to test for a bit, but sonarqube is running now.

thanks