Hi,
I made the assumption that people would do both compilation and analysis in a same go, so they would use the same version of the JVM, but it's true there is many ways to do it.
My need is more for ease of use: I configure Sonar in Jenkins only (i.e. I don't configure it in the pom of my projects when using maven) so I need to set this information for each of my project the Java version (while for the rest of the properties, it can be done using the options provided by Jenkins).
It will be very bothersome to do it for each of the hundreds of projects, some are not using the same version of Java, so I was wondering if this couldn't be inferred by Sonar…
Two other ideas:
* to infer the version in Sonar Scanner: use the information stored in the class (see for example
http://stackoverflow.com/questions/1096148/how-to-check-the-jdk-version-used-to-compile-a-class-file) even though I think it's the target version and not the source one... not sure).
* to ease setup in the Jenkins Plugin: also populate this information when enabling the option "Prepare SonarQube Scanner environment" based on the JDK setup in the project!
I guess the important idea is to know the version used to compile the class, right?
The second idea would be perfect for me, but more generally, it would make sense to assume a version closest as possible to the one of the class.
Thank you!
Victor