Getting Unable to create symbol table for : and java.lang.IllegalArgumentException: Unsupported class file major version 60 Exception

Hi ,

This is my first interaction with Sonar Source.

SonarQube Version : 7.9.4 
JDK : 11
SonarLint : 7.1 
maven compiler version : 3.8.1
Eclipse : Version: 2021-09 (4.21.0)
Spring Tool Suit version :  4.13.0.RELEASE

By Keeping above version in mind I am trying to run my project by connecting to SonarQube.
When I am trying to connect I am getting below error.

Unable to create symbol table for : ‘[uri=file:/C:/Users/z320150/KarthikTN/STS_WorkSpace/Junit5/cvs-v1-planservice-oci-microservice/src/test/java/com/cvshealth/eip/microservices/controller/SamDesDetailsAPITest.java]’
java.lang.IllegalArgumentException: Unsupported class file major version 60
at org.objectweb.asm.ClassReader.(ClassReader.java:195)
at org.objectweb.asm.ClassReader.(ClassReader.java:176)
at org.objectweb.asm.ClassReader.(ClassReader.java:162)
at org.sonar.java.resolve.BytecodeCompleter.loadClass(BytecodeCompleter.java:244)
at org.sonar.java.resolve.Symbols.(Symbols.java:177)
at org.sonar.java.resolve.SemanticModel.createFor(SemanticModel.java:59)
at org.sonar.java.model.VisitorsBridge.visitFile(VisitorsBridge.java:122)
at org.sonar.java.ast.JavaAstScanner.simpleScan(JavaAstScanner.java:90)
at org.sonar.java.ast.JavaAstScanner.scan(JavaAstScanner.java:67)
at org.sonar.java.JavaSquid.scanTests(JavaSquid.java:121)
at org.sonar.java.JavaSquid.scan(JavaSquid.java:110)
at org.sonar.plugins.java.JavaSquidSensor.execute(JavaSquidSensor.java:88)
at org.sonarsource.sonarlint.core.analyzer.sensor.SensorsExecutor.executeSensor(SensorsExecutor.java:80)
at org.sonarsource.sonarlint.core.analyzer.sensor.SensorsExecutor.execute(SensorsExecutor.java:71)

I have tried different SonarLint version like 4.1 , 5 and 6 still I am facing same issue.

Can any one please guide where I am making wrong.

Thanks
Karthik TN

Hi,

Can someone please guide me thru this issues. I am still not able to find the solution.

Thanks
Karthik TN

Hi!

This means that there’s a .class file compiled by JDK 16. Was your project compiled with it? This shouldn’t happen if you stick to JDK 11.

And you’re running an unsupported version of SonarQube (2.5 years old). You need to use the latest SonarQube 9.x version to analyze a project compiled with JDK 16.

Hi @felipebz
Thanks for your feedback.
I have cross checked and I am compiling my .class file on JDK 11 version.

Hi,

It might be caused by a dependency on the classpath that has been compiled with a target for JDK 16. Look at the imports of the class SamDesDetailsAPITest.java to try to find the offending one.

I have resolved the issue by downgrading JDK version to 1.8.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.