I have installed jdk-8-ea-bin-b82-windows-x64-21_mar_2013
and IntelliJ IDEA 12.0.4. The strange thing is that I can't find java.util.stream
in the intellisense provided by the IDE. I tried to compile either using the IDE or using the notepad and the compiler but it gives an error complaining that java.util.stream
cannot be found! I have already set the module settings to use Java8 jdk. Any ideas about this problem?
Introduced in Java 8, the Stream API is used to process collections of objects. A stream is a sequence of objects that supports various methods which can be pipelined to produce the desired result.
All the Java Stream API interfaces and classes are in the java. util. stream package. Since we can use primitive data types such as int, long in the collections using auto-boxing and these operations could take a lot of time, there are specific classes for primitive types - IntStream , LongStream and DoubleStream .
Java stream provides a method filter() to filter stream elements on the basis of given predicate. Suppose you want to get only even elements of your list then you can do this easily with the help of filter method. This method takes predicate as an argument and returns a stream of consisting of resulted elements.
Java provides a new additional package in Java 8 called java. util. stream. This package consists of classes, interfaces and enum to allows functional-style operations on the elements. You can use stream by importing java.
I had the same problem with Netbeans. It seams that older versions of JDK 8 are not correctly packaged.
I had the same problem with b84, but I installed the build b116 and it is working properly.
PS: I think this is what @rmuller said in his comment
To change the JDK version, go to File --> Project Structure, and make sure both Project SDK and Project Language Level are set to JDK 8.
(I know you said you set the JDK level in the modules already, but I'm posting this here because there is relatively little information online on how to do that. Even the IDEA documentation on this issue doesn't mention it!)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With