These lines of code
    System.out.println(
        Stream.of("adam", "bob", "adrian", "brian")
        .collect(
                Collectors.groupingBy(
                        x -> x.substring(0,1),        //1
                        Collectors.joining("-")))
    );
compile fine when using javac via command line, but when I try to compile in Eclipse I get this error
The method substring(int, int) is undefined for the type CharSequence
How can Eclipse interfere with the compiler? Doesn't an IDE just use javac.exe?
I'm using Eclipse Luna 4.4.1, with Oracle jdk1.8.0_45
 
    

 
     
    