With Java 8, executing gradle sonarRunner
shows this error message.
(sonarQube version : 4.2.1)
java.lang.ArrayIndexOutOfBoundsException: 26721
at org.objectweb.asm.ClassReader.readClass(Unknown Source) [asm-all-3.2.jar:5.0_BETA]
at org.objectweb.asm.ClassReader.accept(Unknown Source) [asm-all-3.2.jar:5.0_BETA]
at org.objectweb.asm.ClassReader.accept(Unknown Source) [asm-all-3.2.jar:5.0_BETA]
at org.sonar.java.bytecode.asm.AsmClassProviderImpl.decoracteAsmClassFromBytecode(AsmClassProviderImpl.java:76) [java-squid-2.0.jar:na]
at org.sonar.java.bytecode.asm.AsmClassProviderImpl.getClass(AsmClassProviderImpl.java:55) [java-squid-2.0.jar:na]
at org.sonar.java.bytecode.asm.AsmClassVisitor.visit(AsmClassVisitor.java:52) [java-squid-2.0.jar:na]
at org.objectweb.asm.ClassReader.accept(Unknown Source) [asm-all-3.2.jar:5.0_BETA]
at org.objectweb.asm.ClassReader.accept(Unknown Source) [asm-all-3.2.jar:5.0_BETA]
```
Does SonarQube not support Java 8 yet? I would like to know when support is available.
Thank you.
There are 2 sides to your question:
The error you receive comes from the Java Ecosystem plugins that are downloaded to the client and rely on an old version of ASM (3.2). AFAIK Java 8 support starts with version 5.0. You'll have the same issue with Findbugs and Jacoco. See also this discussion.
Concerning the SonarQube server, you can start it, but it crashes when you select "Configure widgets", so I would say no, it does not support Java 8 yet.
SonarQube supports Java 8 since end of March 2014 (with some hickups at first, which were fixed in version 2.2 of its Java plugin).
I had to uninstall the PMD and Checkstyle plugins in Sonar's update center as those are not ready for Java 8. Sonar's own rule engine Squid should make those plugins redundant anyway.
If you are using Gradle 1.11 to call Sonar and want Jacoco to calculate code coverage, you'll have to specify the latest Jacoco version in order to analyze Java 8 bytecode.
Here's my script that does that when called with
gradle test jacocoTestReport sonarRunner
:It will be supported very soon. See http://jira.codehaus.org/browse/SONARJAVA-386.