I am trying to parse my source code using SonarQube. I am trying to use sonar-scanner as a tool to run analysis from the command line. I followed the recommendations presented in this documentation: http://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner
When I try to test the installation by running sonar-scanner -h , I get the following error:
β ~ sonar-scanner -h Exception in thread "main" java.lang.UnsupportedClassVersionError: org/sonarsource/scanner/cli/Main : Unsupported major.minor version 52.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:800) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) at java.net.URLClassLoader.access$100(URLClassLoader.java:71) at java.net.URLClassLoader$1.run(URLClassLoader.java:361) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
Due to an error, it looks like he did not find the right version of JAVA / JRE to run the cli tool. I understand that this tool should work with any version of Java 1.7+. I am using Oracle JDK 1.7.0_55 . I also tried using OpenJDK 1.8 , but I still get the same error. I also checked that my JAVA_HOME variable is set to the right JDK directory.
Any help in the right direction is appreciated.
java sonarqube sonar-runner
Amrish
source share