The default value is 1.5.
To install the appropriate version, you need to set the sonar.java.source property to tell PMD which version of Java your source code corresponds to.
Possible values: 1.4, 1.5 or 5, 1.6 or 6, 1.7 or 7. Starting with version 2.2 of the plugin, this property can also be set to 1.8 or 8.
If you are using the ant task, just add:
<property name="sonar.java.source" value="${javaversion}"/>
If you are using SonarRunner , just add the line below to the <install_directory>/conf/sonar-runner.properties :
sonar.java.source=1.5
source share