Problems parsing code java 2007

Could the latest sonar generate errors when parsing java 2007 code?.

Currently I work with a Sonar which works with java 11 and I have to analyze java code from 2007 and I would like to know if this could give me errors for the mere fact that being superior gives me errors or if it is better to install a Sonar more in line with this code as the Sonar of version 8 if I remember correctly.

Hey there.

The year the code was developed doesn’t matter so much as… what version of Java it is. Can you clarify what version of Java you’re trying to analyze?

Spoiler alert: You should be able to use the latest version of SonarQube (you shouldn’t try to use an older one), but you will have to make sure Java 11 is available to run the analysis (even if the code is built using an earlier version of Java).

The Scanner Environment documentation is useful here.

Hi Colin.

Can you tell me something else? Can Sonar inspect for a specific version of Java through some kind of code in the console, or does it automatically recognize it?
We are currently reviewing java 7 thank you very much in advance.

Here’s the documentation on Handling Java Source Version. If you are using the Scanner for Maven/Gradle, this should be handled automatically.

Oh thank you very much, I don’t currently work with Maven/Gradle. i will try to use this code