Cannot resolve the symbol 'Arrays'

Answered

I was gone through lot of similar issues in StackOverflow and here, even no luck. So, finally came for your help.

I am using

  1. Windows 7 32bit OS 
  2. java version "1.8.0_221"
  3. IntelliJ Idea 11.0.2

I am doing a basic program in java. But I am getting a compilation error as Cannot resolve the symbol 'Arrays'

My code is this:

import java.util.Arrays;
import java.util.Collections;

import java.util.List;

public class EmployeesData {

    public static List<Employee> getEmployees() {
        return Arrays.asList(
                new Employee(201, "Kumar", "MS", 20000),
                new Employee(202, "Kiran", "Wells", 30000),
                new Employee(201, "Kumar", "Wells", 40000), 
                new Employee(203, "Vishal", "MS", 25000),
                new Employee(203, "Srikanth", "MS", 45000),
                new Employee(204, "Vimal", "Wells", 50000));
    }

    public static List<Employee> getEmployees2() {
        String a = null;
        return Collections.singletonList(
                new Employee(201, "Kumar", "MS", 20000),
                new Employee(202, "Kiran", "Wells", 30000),
                new Employee(201, "Kumar", "Wells", 40000),
                new Employee(203, "Vishal", "MS", 25000),
                new Employee(203, "Srikanth", "MS", 45000),
                new Employee(204, "Vimal", "Wells", 50000));
    }
}

I am getting the same error for Collections class also.

I tried in eclipse also, I am facing the same issue in eclipse also. I tried to specify libraries also. even not solved. Might be something I have to do extra in setting(preferences).

I posted first in stackoverflow(https://stackoverflow.com/questions/57769907/intellij-cannot-resolve-the-symbol-arrays) four days back even not yet resolved.

 

Please help me, please.

0
4 comments

Hello,

JDK 1.8 was released in 2014, so IDEA 11 (released in 2011) might not detect it properly. Please try to use newer IDE version.

0

I tried latest but it won't support 32bit windows os. Finally, I found it very difficultly. Could you please help me which is latest than this whill will support 32bit windows os.

0

Thanks @Yaroslav Bedrov , It resolved, I tried 15.0.6 instead of IntelliJ Idea 11.0.2. Thank you very much once again for your suggestion.

0

You are welcome!

0

Please sign in to leave a comment.