Kepler Service Release 2 and Java 8 support [message #1403923] |
Mon, 28 July 2014 11:25  |
Eclipse User |
|
|
|
Ubuntu Linux 12.04
jdk1.8.0_11
Kepler Service Release 2
followed instructions at
http://www.eclipse.org/downloads/java8/
and installed
Java 8 support for Eclipse Kepler SR2
jdk1.8.0_11 shown and selected in Installed JREs
Compiler compliance level set to 1.8
everything else I can find that has anything to do
with the Java version is also set to 1.8
I have the following code
Integer foo[] = {1, 3, 2, 9, 6, 0, 8, 7, 7, 8, 5, 11, 87, 23, 6};
java.util.List<Integer> il = java.util.Arrays.asList(foo);
java.util.stream.Stream<Integer> s = il.stream();
Eclipse recognizes java.util.Stream as existing
but gives the following error
"the method stream is undefined for the type List<Integer>"
interface List implements interface Collection which provides the method stream() according the API docs.
Is this a bug or am I doing something stupid, it's my first real look at streams so please excuse any stupidity on my part.
thanks
|
|
|
|
|
Re: Kepler Service Release 2 and Java 8 support [message #1403955 is a reply to message #1403947] |
Mon, 28 July 2014 13:25  |
Eclipse User |
|
|
|
You should only have one "JRE System Library" entry. It is what dictates which JRE's class library your project compiles against. If that method was new to 1.8, then it would not have been found within the class definition in the 1.7 JRE.
[Updated on: Mon, 28 July 2014 13:26] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.10962 seconds