I recently installed JDK 8 on my Eclipse (MAC) and I m trying to use the streams.
However, it seems that Java 8 is not correctly configured since I get the following error on the following line of code:
List<Eshop> tempShops = eshops.stream().filter( e -> e.getName().equals(name)).collect(Collectors.toList());
Multiple markers at this line
- e cannot be resolved to a variable
- e cannot be resolved
- Syntax error on token "-", --
expected
Anybody has an idea what might be wrong?
EDIT Also tried like
List<Eshop> tempShops = eshops.stream().filter( (e) -> e.getName().equals(name)).collect(Collectors.toList());