简体   繁体   中英

Can't find java.util.stream in java8

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?

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!)

尝试从以下网址下载: http//jdk8.java.net/lambda/以获得lambda和stream支持

As @rmuller pointed out there was no streams in the early release version that I have downloaded 5 years ago when I asked the question. Short while after I asked the question a new release was available and it contained the streams support.

YOU CAN SET PROJECT SETTING IN MODULES

THE LANGUAGE LEVEL SET 8-LAMBDAS enter image description here

BEACUSE THE DEFAULT LANGUAGE LEVEL IS 7 -Diamonds

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM