Hi,
Ive got a working project with java8 and publishing data to sonarqube. When i move the java version used to 10, it is not working anymore. That is the only change I do.
On that project, if you execute it with 2 different jre (such as 9 and 10), you will have different results.
Versions used
sonar gradle plugin: 2.6.2
sonarqube docker image: 7.1
java 9: Java™ SE Runtime Environment (build 9+181)
java 10: Java™ SE Runtime Environment 18.3 (build 10.0.1+10)
Error observed
Basically, with java10, the build is failing with stack like that for all classes:
Unable to create symbol table for : /Users/user/devtools/code/sonarqube-sample/src/test/java/com/example/sonarqubesample/SonarqubeSampleApplicationTests.java
java.lang.IllegalArgumentException: null
at org.objectweb.asm.ClassReader.(ClassReader.java:160)
at org.objectweb.asm.ClassReader.(ClassReader.java:143)
The steps to reproduce are described in the readme of the sample repository.
Hi Ann,
Thank you for the quick reply, that’s sound a fair answer
So what do you recommend if I want to have a java 9+ project, as java9 is not supported anymore? Should I still go for java9 at the moment, and move to a java 10 jdk when that will be supported by sonarqube?
the reason why your analysis is failing is because you are using older version of SonarQube. You can either upgrade your SonarQube to 7.2 , or you can upgrade SonarJava plugin in your SQ instance.
You should be able to run analysis using Java 10 in general. If you encounter any issues, let us know here and we will try to fix it.