Using JShell of java 13.0.1 on Debian Stretch:
import static java.nio.file.Files.*;
var hm=Path.of(System.getProperty("user.home"));
void p(String s) {System.out.println(s);}
list(hm).sorted((a,b)->a.compareTo(b)).forEach(x -> p(x.toString().substring(hm.toString().length()+1)));
list(hm).sorted().forEach(x -> p(x.toString().substring(hm.toString().length()+1)));
"a".compareToIgnoreCase("A");
This all works (it lists the files in the home folder two times, and returns 0).
But when I enter:
list(hm).sorted((a,b)->a.compareToIgnoreCase(b)).forEach(x -> p(x.toString().substring(hm.toString().length()+1)));
It leads to an error:
Cannot find symbol, symbol: method compareToIgnoreCase.
Any idea what make compareToIgnoreCase to fail?