sonar runner - "The plugin java is not supported with Java 1.6.0_45" from SonarQube 4.5.4 with a specify java version 1.7 -
i'm trying configure sonarqube 4.5.4 on server. sonarqube version, needs jdk 1.7, in case of building android system firmware, jdk 1.6 can set default jdk.
now jdk 1.7 still on computer, not defalut one. in order make sonarqube run, jdk 1.7's absolute path specified in /conf/wrapper.conf under following line:
wrapper.java.command=/usr/lib/jvm/java-7-oracle/jre/bin/java
after this, jdk 1.7 can seen sonar's setting:
ok, sonar-runner ready analysis demo code. unfortunately, error throw:
emporia@emporia-ubuntu:~/lawrence/sonar-examples-master/projects/languages/java/sonar-runner/java-sonar-runner-simple$ sonar-runner -x sonarqube runner 2.4 java 1.6.0_45 sun microsystems inc. (64-bit) linux 2.6.32-62-generic amd64 info: error stacktraces turned on. info: runner configuration file: /opt/sonar-runner-2.4/conf/sonar-runner.properties info: project configuration file: /home/emporia/lawrence/sonar-examples-master/projects/languages/java/sonar-runner/java-sonar-runner-simple/sonar-project.properties info: default locale: "en_us", source code encoding: "utf-8" info: work directory: /home/emporia/lawrence/sonar-examples-master/projects/languages/java/sonar-runner/java-sonar-runner-simple/./.sonar info: sonarqube server 4.5.4 16:42:00.393 info - load global referentials... 16:42:00.442 debug - download: http://localhost:9000/batch/global (no proxy) 16:42:00.799 info - load global referentials done: 409 ms 16:42:00.873 info - user cache: /home/emporia/.sonar/cache 16:42:01.524 info - install plugins 16:42:01.524 debug - download index of plugins 16:42:01.524 debug - download: http://localhost:9000/deploy/plugins/index.txt (no proxy) info: ------------------------------------------------------------------------ info: execution failure info: ------------------------------------------------------------------------ total time: 3.208s final memory: 2m/240m info: ------------------------------------------------------------------------ error: error during sonar runner execution org.sonar.runner.impl.runnerexception: unable execute sonar @ org.sonar.runner.impl.batchlauncher$1.delegateexecution(batchlauncher.java:91) @ org.sonar.runner.impl.batchlauncher$1.run(batchlauncher.java:75) @ java.security.accesscontroller.doprivileged(native method) @ org.sonar.runner.impl.batchlauncher.doexecute(batchlauncher.java:69) @ org.sonar.runner.impl.batchlauncher.execute(batchlauncher.java:50) @ org.sonar.runner.api.embeddedrunner.doexecute(embeddedrunner.java:102) @ org.sonar.runner.api.runner.execute(runner.java:100) @ org.sonar.runner.main.executetask(main.java:70) @ org.sonar.runner.main.execute(main.java:59) @ org.sonar.runner.main.main(main.java:53) caused by: org.sonar.api.utils.sonarexception: plugin java not supported java 1.6.0_45 @ org.sonar.core.plugins.pluginclassloaders.instantiateplugin(pluginclassloaders.java:230) @ org.sonar.core.plugins.pluginclassloaders.init(pluginclassloaders.java:97) @ org.sonar.batch.bootstrap.batchpluginrepository.dostart(batchpluginrepository.java:99) @ org.sonar.batch.bootstrap.batchpluginrepository.start(batchpluginrepository.java:72) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:39) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:25) @ java.lang.reflect.method.invoke(method.java:597) @ org.picocontainer.lifecycle.reflectionlifecyclestrategy.invokemethod(reflectionlifecyclestrategy.java:110) @ org.picocontainer.lifecycle.reflectionlifecyclestrategy.start(reflectionlifecyclestrategy.java:89) @ org.picocontainer.injectors.abstractinjectionfactory$lifecycleadapter.start(abstractinjectionfactory.java:84) @ org.picocontainer.behaviors.abstractbehavior.start(abstractbehavior.java:169) @ org.picocontainer.behaviors.stored$realcomponentlifecycle.start(stored.java:132) @ org.picocontainer.behaviors.stored.start(stored.java:110) @ org.picocontainer.defaultpicocontainer.potentiallystartadapter(defaultpicocontainer.java:1015) @ org.picocontainer.defaultpicocontainer.startadapters(defaultpicocontainer.java:1008) @ org.picocontainer.defaultpicocontainer.start(defaultpicocontainer.java:766) @ org.sonar.api.platform.componentcontainer.startcomponents(componentcontainer.java:92) @ org.sonar.batch.bootstrapper.batch.start(batch.java:81) @ org.sonar.batch.bootstrapper.batch.execute(batch.java:67) @ org.sonar.runner.batch.isolatedlauncher.execute(isolatedlauncher.java:48) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:39) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:25) @ java.lang.reflect.method.invoke(method.java:597) @ org.sonar.runner.impl.batchlauncher$1.delegateexecution(batchlauncher.java:87) ... 9 more caused by: java.lang.unsupportedclassversionerror: org/sonar/plugins/java/javaplugin : unsupported major.minor version 51.0 @ java.lang.classloader.defineclass1(native method) @ java.lang.classloader.defineclasscond(classloader.java:631) @ java.lang.classloader.defineclass(classloader.java:615) @ java.security.secureclassloader.defineclass(secureclassloader.java:141) @ java.net.urlclassloader.defineclass(urlclassloader.java:283) @ java.net.urlclassloader.access$000(urlclassloader.java:58) @ java.net.urlclassloader$1.run(urlclassloader.java:197) @ java.security.accesscontroller.doprivileged(native method) @ java.net.urlclassloader.findclass(urlclassloader.java:190) @ org.codehaus.plexus.classworlds.realm.classrealm.loadclassfromself(classrealm.java:389) @ org.codehaus.plexus.classworlds.strategy.selffirststrategy.loadclass(selffirststrategy.java:42) @ org.codehaus.plexus.classworlds.realm.classrealm.unsynchronizedloadclass(classrealm.java:259) @ org.codehaus.plexus.classworlds.realm.classrealm.loadclass(classrealm.java:242) @ org.codehaus.plexus.classworlds.realm.classrealm.loadclass(classrealm.java:227) @ org.sonar.core.plugins.pluginclassloaders.instantiateplugin(pluginclassloaders.java:226) ... 34 more
since jdk 1.7 set sonarqube 4.5.4, why throw error? should still need specify jdk 1.7 sonar-runner, didn't find place configure it.
specify java sonar-runner in hack way:
- edit file
<sonar_runner_directory>/bin/sonar-runner
- find line
java_cmd="'which java'"
- change command target java's absolute path, mine:
java_cmd=/usr/lib/jvm/java-7-oracle/jre/binjava
.
Comments
Post a Comment