Specifying sonar.java.target does not work

Since SonarSource gives us no information as to when Java versions beyond 11 will be supported (…) I’ve tried to run analysis with JDK 14 using sonar.java.target=11. My idea is that while using JDK 14 (which I require for jpackager) I can still create Java 11 byte code and thus sonar should work just fine.

However I still get:

[rli@rlimbus CLI]$ gradlew -Dsonar.java.target=11 sonarqube
> Task :project:libs:CLI:sonarqube
Unable to create symbol table for : /home/rli/devel/repository/source/java/project/libs/CLI/src/main/java/com/synedra/util/cli/Command.java
java.lang.IllegalArgumentException: Unsupported class file major version 58

I’ve also tried to specify the property in build.gradle to no avail.
So while my project really has Java 11 - bytecode:

[rli@rlimbus CLI]$ file build/classes/java/main/com/synedra/util/cli/Command.class 
build/classes/java/main/com/synedra/util/cli/Command.class: compiled Java class data, version 55.0

it seems like sonar is recompiling behind the scenes for analysis and will not take into account the sonar.java.target property.

Any hint appreciated

Hi,

You can’t run analysis on Java versions > 11. You’ll have to downgrade.

Meanwhile, we do support analysis of up to Java 13.

 
Ann