I am using jdk1.8.0_121 on eclipse kepler (My OS is windows 7), I have created a simple project contained one class with static main method.
When I tried to create a list as follow
List l = Arrays.asList(1,2);
I got this error :
The method asList(T[]) in the type Arrays is not applicable for the arguments (int, int).
In case anyone else comes across a similar issue, I found that I had this error because I was importing
edu.emory.mathcs.backport.java.util.Arrays;
instead of
java.util.Arrays;
I have faced same issue like wrongly imported org.javers.common.collection.arrays
So removed that one and imported from Utils Arrays got
I think you need to put an array as the parameter of asList. like:
int[] data = {1,2,3,4,5};
List list = Arrays.asList(data);