Java 14 Support?

What exactly does Java 14 support mean with respect to SonarQube 8.5?

  • I have SonarQube 8.5.1 installed along with JDK 14.
  • Client is using JDK 14 to compile.
  • Client code uses the new Java switch statement.

<dependency> <groupId>org.sonarsource.scanner.maven</groupId> <artifactId>sonar-maven-plugin</artifactId> <version></version> </dependency>

However, I’m seeing the following when running mvn sonar:sonar
[ERROR] Unable to parse source file : 'src/main/java/com/xyz/' [ERROR] Parse error at line 71 column 21: Switch Expressions are supported from Java 14 onwards only

The most recent version of the sonar scanner, as noted above, was released in Oct 2019 while Java 14 was released in Mar 2020.

So, what exactly does it mean that Java 14 is supported in SonarQube when the scanner is not receiving the necessary updates to provide that support?


Welcome to the community!

Are you passing a value that’s lower than 14 to analysis? Either explicitly or perhaps implicitly by targeting compilation to a lower version?


Thanks. I added <>14</> to my pom properties and the error I reported above is gone. Thank you.

I’m now having a similar problem with the checkstyle sensor complaining about the new switch statement syntax:
Can not execute Checkstyle: Exception was thrown while processing ...\ occurred while parsing file unexpected token: result ->

Hi Ann, and to answer your questions about the version of Java my maven build is targeting I am specifying Java 14 via the compiler plugin:



Thanks for getting back to me.

For the Checkstyle error you’ll need to report that in that project to those maintainers.