title: Bad version number in .class file after upgrading Sonar to 3.6
body: <p>We're analyzing some projects still builded with java 5 against sonar itself running on java 7. After upgrade to sonar 3.6 we get this exception:</p>
  
  <pre><code>org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project uno: Can not execute Sonar
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
      at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
      at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:592)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
      at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
  Caused by: org.apache.maven.plugin.MojoExecutionException: Can not execute Sonar
      at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:118)
      at org.codehaus.mojo.sonar.Bootstraper.start(Bootstraper.java:65)
      at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:90)
      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
      ... 19 more
  Caused by: org.apache.maven.plugin.PluginContainerException: Unable to load the mojo 'sonar' in the plugin 'org.codehaus.sonar:sonar-maven3-plugin:3.6' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: Bad version number in .class file
  -----------------------------------------------------
  realm =    plugin&gt;org.codehaus.sonar:sonar-maven3-plugin:3.6
  strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
  urls[0] = file:/E:/maven_repo/org/codehaus/sonar/sonar-maven3-plugin/3.6/sonar-maven3-plugin-3.6.jar
  urls[1] = file:/E:/maven_repo/org/apache/maven/shared/maven-dependency-tree/1.2/maven-dependency-tree-1.2.jar
  urls[2] = file:/E:/maven_repo/org/codehaus/plexus/plexus-utils/1.4.1/plexus-utils-1.4.1.jar
  urls[3] = file:/E:/maven_repo/junit/junit/4.10/junit-4.10.jar
  urls[4] = file:/E:/maven_repo/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1.jar
  urls[5] = file:/E:/maven_repo/org/codehaus/sonar/sonar-batch/3.6/sonar-batch-3.6.jar
  urls[6] = file:/E:/maven_repo/com/akiban/akiban-persistit/3.2.7/akiban-persistit-3.2.7.jar
  urls[7] = file:/E:/maven_repo/org/codehaus/sonar/sonar-core/3.6/sonar-core-3.6.jar
  urls[8] = file:/E:/maven_repo/org/mybatis/mybatis/3.1.1/mybatis-3.1.1.jar
  urls[9] = file:/E:/maven_repo/org/codehaus/sonar/sonar-update-center-common/1.6.1/sonar-update-center-common-1.6.1.jar
  urls[10] = file:/E:/maven_repo/org/hibernate/hibernate-core/3.3.2.GA/hibernate-core-3.3.2.GA.jar
  urls[11] = file:/E:/maven_repo/antlr/antlr/2.7.6/antlr-2.7.6.jar
  urls[12] = file:/E:/maven_repo/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar
  urls[13] = file:/E:/maven_repo/org/hibernate/hibernate-annotations/3.4.0.GA/hibernate-annotations-3.4.0.GA.jar
  urls[14] = file:/E:/maven_repo/org/hibernate/ejb3-persistence/1.0.2.GA/ejb3-persistence-1.0.2.GA.jar
  urls[15] = file:/E:/maven_repo/org/hibernate/hibernate-commons-annotations/3.1.0.GA/hibernate-commons-annotations-3.1.0.GA.jar
  urls[16] = file:/E:/maven_repo/org/hibernate/hibernate-entitymanager/3.4.0.GA/hibernate-entitymanager-3.4.0.GA.jar
  urls[17] = file:/E:/maven_repo/javassist/javassist/3.4.GA/javassist-3.4.GA.jar
  urls[18] = file:/E:/maven_repo/geronimo-spec/geronimo-spec-jta/1.0-M1/geronimo-spec-jta-1.0-M1.jar
  urls[19] = file:/E:/maven_repo/commons-dbcp/commons-dbcp/1.4/commons-dbcp-1.4.jar
  urls[20] = file:/E:/maven_repo/commons-pool/commons-pool/1.5.4/commons-pool-1.5.4.jar
  urls[21] = file:/E:/maven_repo/com/tinkerpop/blueprints/blueprints-core/2.2.0/blueprints-core-2.2.0.jar
  urls[22] = file:/E:/maven_repo/org/slf4j/jcl-over-slf4j/1.6.2/jcl-over-slf4j-1.6.2.jar
  urls[23] = file:/E:/maven_repo/org/slf4j/log4j-over-slf4j/1.6.2/log4j-over-slf4j-1.6.2.jar
  urls[24] = file:/E:/maven_repo/org/codehaus/sonar/sonar-deprecated/3.6/sonar-deprecated-3.6.jar
  urls[25] = file:/E:/maven_repo/org/codehaus/sonar/sonar-home/3.6/sonar-home-3.6.jar
  urls[26] = file:/E:/maven_repo/commons-io/commons-io/2.0.1/commons-io-2.0.1.jar
  urls[27] = file:/E:/maven_repo/org/codehaus/sonar/sonar-java-api/3.6/sonar-java-api-3.6.jar
  urls[28] = file:/E:/maven_repo/org/codehaus/sonar/sonar-plugin-api/3.6/sonar-plugin-api-3.6.jar
  urls[29] = file:/E:/maven_repo/org/codehaus/sonar/sonar-check-api/3.6/sonar-check-api-3.6.jar
  urls[30] = file:/E:/maven_repo/org/codehaus/sonar/sonar-colorizer/3.6/sonar-colorizer-3.6.jar
  urls[31] = file:/E:/maven_repo/org/codehaus/sonar/sonar-channel/3.6/sonar-channel-3.6.jar
  urls[32] = file:/E:/maven_repo/org/codehaus/sonar/sonar-duplications/3.6/sonar-duplications-3.6.jar
  urls[33] = file:/E:/maven_repo/org/codehaus/sonar/sonar-graph/3.6/sonar-graph-3.6.jar
  urls[34] = file:/E:/maven_repo/com/google/guava/guava/10.0.1/guava-10.0.1.jar
  urls[35] = file:/E:/maven_repo/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar
  urls[36] = file:/E:/maven_repo/commons-codec/commons-codec/1.4/commons-codec-1.4.jar
  urls[37] = file:/E:/maven_repo/jfree/jfreechart/1.0.9/jfreechart-1.0.9.jar
  urls[38] = file:/E:/maven_repo/jfree/jcommon/1.0.12/jcommon-1.0.12.jar
  urls[39] = file:/E:/maven_repo/com/thoughtworks/xstream/xstream/1.3.1/xstream-1.3.1.jar
  urls[40] = file:/E:/maven_repo/xpp3/xpp3/1.1.3.3/xpp3-1.1.3.3.jar
  urls[41] = file:/E:/maven_repo/org/codehaus/woodstox/woodstox-core-lgpl/4.0.4/woodstox-core-lgpl-4.0.4.jar
  urls[42] = file:/E:/maven_repo/org/codehaus/woodstox/stax2-api/3.0.1/stax2-api-3.0.1.jar
  urls[43] = file:/E:/maven_repo/stax/stax-api/1.0.1/stax-api-1.0.1.jar
  urls[44] = file:/E:/maven_repo/org/codehaus/staxmate/staxmate/2.0.0/staxmate-2.0.0.jar
  urls[45] = file:/E:/maven_repo/xerces/xercesImpl/2.8.1/xercesImpl-2.8.1.jar
  urls[46] = file:/E:/maven_repo/xml-apis/xml-apis/1.3.03/xml-apis-1.3.03.jar
  urls[47] = file:/E:/maven_repo/xalan/xalan/2.7.1/xalan-2.7.1.jar
  urls[48] = file:/E:/maven_repo/xalan/serializer/2.7.1/serializer-2.7.1.jar
  urls[49] = file:/E:/maven_repo/org/codehaus/sonar/sonar-squid/3.6/sonar-squid-3.6.jar
  urls[50] = file:/E:/maven_repo/org/picocontainer/picocontainer/2.14.3/picocontainer-2.14.3.jar
  urls[51] = file:/E:/maven_repo/commons-lang/commons-lang/2.6/commons-lang-2.6.jar
  urls[52] = file:/E:/maven_repo/commons-configuration/commons-configuration/1.6/commons-configuration-1.6.jar
  urls[53] = file:/E:/maven_repo/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar
  urls[54] = file:/E:/maven_repo/commons-digester/commons-digester/1.8/commons-digester-1.8.jar
  urls[55] = file:/E:/maven_repo/commons-beanutils/commons-beanutils/1.8.3/commons-beanutils-1.8.3.jar
  urls[56] = file:/E:/maven_repo/com/google/code/gson/gson/2.2.4/gson-2.2.4.jar
  urls[57] = file:/E:/maven_repo/com/googlecode/json-simple/json-simple/1.1.1/json-simple-1.1.1.jar
  urls[58] = file:/E:/maven_repo/com/h2database/h2/1.3.167/h2-1.3.167.jar
  urls[59] = file:/E:/maven_repo/org/slf4j/slf4j-api/1.6.2/slf4j-api-1.6.2.jar
  urls[60] = file:/E:/maven_repo/ch/qos/logback/logback-classic/0.9.30/logback-classic-0.9.30.jar
  urls[61] = file:/E:/maven_repo/ch/qos/logback/logback-core/0.9.30/logback-core-0.9.30.jar
  Number of foreign imports: 1
  import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
  
  realm =    plugin&gt;org.codehaus.mojo:sonar-maven-plugin:2.0
  strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
  urls[0] = file:/E:/maven_repo/org/codehaus/mojo/sonar-maven-plugin/2.0/sonar-maven-plugin-2.0.jar
  urls[1] = file:/E:/maven_repo/org/sonatype/aether/aether-util/1.7/aether-util-1.7.jar
  urls[2] = file:/E:/maven_repo/org/codehaus/plexus/plexus-interpolation/1.14/plexus-interpolation-1.14.jar
  urls[3] = file:/E:/maven_repo/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
  urls[4] = file:/E:/maven_repo/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
  urls[5] = file:/E:/maven_repo/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
  urls[6] = file:/E:/maven_repo/org/sonatype/sisu/sisu-inject-bean/1.4.2/sisu-inject-bean-1.4.2.jar
  urls[7] = file:/E:/maven_repo/org/sonatype/sisu/sisu-guice/2.1.7/sisu-guice-2.1.7-noaop.jar
  urls[8] = file:/E:/maven_repo/org/codehaus/plexus/plexus-utils/2.0.4/plexus-utils-2.0.4.jar
  Number of foreign imports: 1
  import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
  
  -----------------------------------------------------
  
      at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:485)
      at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:111)
      ... 23 more
  Caused by: java.lang.UnsupportedClassVersionError: Bad version number in .class file
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
      at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
      at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
      at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClassFromSelf(ClassRealm.java:386)
      at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:42)
      at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
      at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
      at org.sonatype.guice.bean.reflect.URLClassSpace.loadClass(URLClassSpace.java:101)
      at org.sonatype.guice.bean.reflect.NamedClass.load(NamedClass.java:45)
      at org.sonatype.guice.bean.reflect.AbstractDeferredClass.get(AbstractDeferredClass.java:45)
      at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:84)
      at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:52)
      at com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:70)
      at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:100)
      at org.sonatype.guice.plexus.lifecycles.PlexusLifecycleManager.onProvision(PlexusLifecycleManager.java:138)
      at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:108)
      at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:55)
      at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:68)
      at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:45)
      at com.google.inject.internal.InjectorImpl$3$1.call(InjectorImpl.java:965)
      at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1011)
      at com.google.inject.internal.InjectorImpl$3.get(InjectorImpl.java:961)
      at com.google.inject.Scopes$1$1.get(Scopes.java:59)
      at org.sonatype.guice.bean.locators.LazyBeanEntry.getValue(LazyBeanEntry.java:83)
      at org.sonatype.guice.plexus.locators.LazyPlexusBean.getValue(LazyPlexusBean.java:49)
      at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:253)
      at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:245)
      at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:455)
      ... 24 more
  </code></pre>
  
  <p>Sonar itself now requires at least java 6 (<a href="http://jira.codehaus.org/browse/SONAR-4044">http://jira.codehaus.org/browse/SONAR-4044</a>), but according to comment <a href="http://jira.codehaus.org/browse/SONAR-4044?focusedCommentId=325018&amp;page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-325018">http://jira.codehaus.org/browse/SONAR-4044?focusedCommentId=325018&amp;page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-325018</a>, this should not affect java version of analyzed code.</p>
  
  <p>Any ideas?</p>