SonarCube pluging not working.

412 views
Skip to first unread message

Neil Watson

unread,
Oct 12, 2016, 11:34:31 AM10/12/16
to Jenkins Users
Greetings,

I'm having trouble getting the SonarCube plugin to work, and I'm rather new to Jenkins.  The error from the build job is:

11:26:32 [workspace] $ /var/lib/jenkins/tools/hudson.plugins.sonar.SonarRunnerInstallation/sonarqube-scanner-2.8/bin/sonar-runner -X -e -Dsonar.jdbc.url=jdbc:mysql://10.120.8.27:3306/sonar?autoReconnect=true&useUnicode=true&characterEncoding=utf8 ******** -Dsonar.host.url=http://10.120.8.27:9000/sonar/ ******** ******** -Dsonar.projectBaseDir=/var/lib/jenkins/jobs/set-rel-ver-myapp-access_controller/workspace
11:26:32 WARN: sonar-runner script is deprecated. Please use sonar-scanner instead.
11:26:32 Exception in thread "main" java.lang.UnsupportedClassVersionError: org/sonarsource/scanner/cli/Main : Unsupported major.minor version 52.0
11:26:32 	at java.lang.ClassLoader.defineClass1(Native Method)
11:26:32 	at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
11:26:32 	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
11:26:32 	at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
11:26:32 	at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
11:26:32 	at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
11:26:32 	at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
11:26:32 	at java.security.AccessController.doPrivileged(Native Method)
11:26:32 	at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
11:26:32 	at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
11:26:32 	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
11:26:32 	at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
11:26:32 	at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
11:26:32 Build step 'Execute SonarQube Scanner' marked build as failure
11:26:32 Started calculate disk usage of build


Why is the plugin running the deprecated sonar-runner and what does the exception mean?

Matthew...@diamond.ac.uk

unread,
Oct 12, 2016, 11:53:32 AM10/12/16
to jenkins...@googlegroups.com

If you google for “Unsupported major.minor version 52.0” you’ll find the answer to that – you have class files compiled with one Java version (probably some pre-compiled .jars you got from somewhere), but you are running under a different Java version ( the class files are probably Java 8, and you are trying to run using Java 6 or 7).

As far as the deprecated issue is concerned, I can’t comment, sorry.

Matthew

 

-- 

This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail.
Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd.
Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message.
Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom
 

Neil Watson

unread,
Oct 12, 2016, 12:31:37 PM10/12/16
to Jenkins Users, Matthew...@diamond.ac.uk
Correct. Adding a JDK to Jenkins and specifying to use it in the SonarQube section of the job worked.
Reply all
Reply to author
Forward
0 new messages