IllegalArgumentException In Java File Sonar Scanning

  • versions used (sonarqube-6.7.7, sonar-scanner-cli-4.4.0.2170-windows)
  • error observed (wrap logs/code around triple quote ``` for proper formatting)
ERROR: Unable to create symbol table for : C:\SonarTest\Test\src\com\MainClass.java
java.lang.IllegalArgumentException: null
        at org.objectweb.asm.ClassReader.<init>(ClassReader.java:185)

Java File
package com;
import java.util.ArrayList;
import java.util.List;

public class MainClass {
	public static void main(String[] args) {
		int a=10;
		//System.out.println("Value of a=");
	}
}

This is my first sonarQube implemntation but in beggiing i am getting this error for a small java file code.I have java version 8 installed on my machine.I google it for this issue but no luck.
Please help me.
Thanks & Regards
Amitabh Pandey

Hello,

You are using a very old version of SonarQube, which is actually not maintained anymore. Please download a more recent version of SonarQube to at least version 7.9 (LTS) or our latest release (8.X).

If you still encounter the issue after the update, please provide updated information of your SonarQube instance (especially sonar-java-plugin version, jdk version, and analysis method/configuration).

Regards,
Michael

Hi Michael,
7.9 version requires java11 while i have java 8 version.As per your response i am concluding that older versions of sonarQube won’t work and not supported.If i have to use 7.9 version then i must have to download java 11 right?

Also please let me know will i have to use latest version of SonarQube scanner also?

Thanks

Hey,

Yes, you will have to install java 11, to run both your SonarQube instance AND the corresponding scanner. However, while running SonarQube on Java 11, you can still perfectly analyze Java 8 projects.

Regards,
Michael