0

I am running a build with sonarqube 4.5.1 and JDK 6. I am getting this following error:

[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project test-util: The plugin java is not supported with Java 1.6.0_26: org/sonar/plugins/java/JavaPlugin : Unsupported major.minor version 51.0 

I found one document on internet which says that JDK 6 is no longer supported to run SonarQube starting from 4.5.1.

Could anyone please confirm , if this error message is because JDK 6 is no longer supported with sonarqube 4.5.1?

Thanks in advance.

2 Answers2

2

Yes, you need JDK 7 or later (see How to fix: Unsupported major.minor version 51.0 error?).

You can still build your project with JDK 6, but SonarQube analysis should be executed by JDK 7 or later.

Community
  • 1
  • 1
agabrys
  • 8,728
  • 3
  • 35
  • 73
  • This means I only need JDK7 (or now 8 according to http://eclipse.hello2morrow.com/doc/build/content/sonarqube_integration.html ) but the sourcecode of the application can still be for jdk6? – bish Jul 06 '16 at 08:06
  • Yes, you have two options. 1) compile application using JDK6 but run analysis using JDK7 or later 2) compile (javac ``-source`` attribute equal to ``1.6``) and run analysis using JDK7 or later – agabrys Jul 06 '16 at 08:25
0

You can run Sonar 4.5.1 version with jdk1.6 , provided you give a sonar-maven-plugin jar which is compatible with java6.

sonar-maven-plugin version 2.4 is not compatible with java 6 and it works with java 7.

We are also doing the same, compiling the project with Java 6 and running sonar analysis with Java 7.

Can anyone provide the sonar-maven-plugin version < 2.4 which is compatible with java 6. As of now i am trying with sonar-maven-plugin 2.3.1 but don't know whether it will work, will update the result soon.

Joy Chowdhury
  • 73
  • 1
  • 10