2

I'm getting below error while trying to analyse code using Sonar plugin. I got jre7 installed on my machine and used in eclipse same as SonarQube server.

Config INFO:

Sonar Server 5.2 java.runtime.version   1.7.0_40-b60
java.specification.name Java Platform API Specification
java.specification.vendor   Oracle Corporation
java.specification.version  1.7 java.vendor Oracle Corporation
java.vendor.url http://java.oracle.com/
java.vendor.url.bug http://bugreport.sun.com/bugreport/
java.version    1.7.0_40 java.vm.info   mixed mode java.vm.name Java
HotSpot(TM) Client VM java.vm.specification.name    Java Virtual
Machine Specification java.vm.specification.vendor  Oracle
Corporation java.vm.specification.version   1.7 java.vm.vendor  Oracle
Corporation java.vm.version 24.0-b56

Error:

Exception in thread "main" java.lang.UnsupportedClassVersionError:   
org/sonar/api/utils/SonarException : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$000(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)

Thanks

Tunaki
  • 132,869
  • 46
  • 340
  • 423
Vinoth M
  • 21
  • 2
  • 3
    It looks like you do not use that JRE to run SonarQube. Also, you should really be using a JDK, not a JRE. – fge Nov 17 '15 at 14:01
  • 1
    Possible duplicate of [How to fix: Unsupported major.minor version 51.0 error?](http://stackoverflow.com/questions/10382929/how-to-fix-unsupported-major-minor-version-51-0-error) – beresfordt Nov 17 '15 at 14:05
  • by the way: [SonarQube plugin is deprecated](http://docs.sonarqube.org/display/SONAR/Installing+SonarQube+in+Eclipse). You should switch to [SonarLint](http://www.sonarlint.org/). – agabrys Nov 19 '15 at 21:15

0 Answers0