Can't find java.util.stream in java8 - intellij-idea

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

Try to download from: http://jdk8.java.net/lambda/ to have lambda and stream support

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

Related

How to fix problem 'Update plugin to start this course' for jetbrain's Learn Rust course?

I am trying to get jetbrain's rust course working but I have this problem:
I have installed the rust toolchain and the rust plugin. When I click update on the problem this comes up:
so I press ok and nothing happens. Does anyone know what the problem could be?
I am using Intellij community with the education version and I am on a windows machine.
This is caused by https://youtrack.jetbrains.com/issue/EDC-740/Cannot-start-Learn-Rust-Course
Please try the course again and it should work now.
The problem here is that the course published from nightly plugin version where a new version of the archive format was introduced (15).
As a result, stable plugin complains that it doesn't support the new format version but at this moment there isn't new stable version with new format support
An archive generated with the stable EduTools is uploaded, the corrupted version is hidden. It should be ok now.

Do I need to download javafx12?

I have been having trouble utilizing Javafx within Intellij. I run into the error "JavaFX runtime components are missing, and are required to run this application" that I see a lot of other people have.
My main question is do I need to download Javafx12 sdk. I am able to use Dr.Java to run some of my old javafx projects just fine after adding an extra class path and I haven't needed to downloaded anything. It doesn't seem like I need to download anything as another much more basic IDE is able to run javafx. So why does it seem like intellij requires an extra download?
If you moved to Java 12, then yes, you need to download the JavaFX 12 from their new website https://openjfx.io. Luckily installing it is pretty straightforward and well-explained.
It worked before because JavaFX was shipped inside the JDK distribution, which is no longer the case. Swing however is still there and will work as before. (I am not saying you go back to Swing, just that it is still shipped along the JDK)

How I can use the JavaFX framework?

firstly, I want let you know how useful this community is for me, I was stuck on an error
`Error: JavaFX runtime components are missing, and are required to run this application`
and thanks to this answer I actually solved: link
However I've a couple of questions. I noticed that IntelliJ doesn't change the configurations (Like set the VM option and pick the right library for the javaFX project), so each time I've to create a new JavaFX11 or 12 project I've to being throw all the manually settings again.
There's a way for set a "default behaviour" for the IDE ? It's really cumbersome.
The second question is, how I can use all the beautiful framework that the developer community offer for JavaFX? I've seen on openjFX a couple of interesting framework like TilesFX or CalendarFX but there's no information on how implement them on my IDE neither on GitHub nor here.
I have seen that most of them uses Gradle files, but honestly I don't have the faintest idea of what this kind of file does and how implement it on IntelliJ. Thank's to everybody.
Run the project with a more recent JDK like JDK11, for example.
If it does'nt work, you probably forgot to change the JDK of your builder in IntelliJ!
Open the settings and follow the path as bellow:
FOR MAVEN
FOR GRADLE

intellij unresolved symbol for go lang project

I am using go sdk 1.2.1 linux/386 in intellij 14.0.3. However, when I open a golang project many function and variable are unresolved. I do not what is wrong with intellij. Anything that I can do to make the unresolved symbol solved. I have met the problems before. but I do not know to to solve it. Anyone have met the same problem before? Please help.
Thanks.
As I have no information about which plugin version you are using I'm going to assume that you have 0.9.15.3 release.
The fastest way to fix it would be to use one of the early releases for 1.0.0, available here: github releases page for go plugin for intellij idea
The plugin is currently under a major refactoring and we've started releasing preview builds for it. While the alpha name might be scary, I'm using it daily at work and it's very stable but not everything is up on par with the quality we want it to have.
If you have any further questions, either ask here or browse in the issue tracker
Also, there's a small community on Gitter and you may get answers from there as well.

IntelliJ: cannot find java.util.Optional

In a new project in IntelliJ I have set up a Java 8 JRE/JDK and language level 8.0.
But for some reason, the IDE cannot find java.util.Optional. The project compiles and works just fine (from within the IDE, too) but code completion does not work.
Any ideas? I'd like to ask a few other users before creating a ticket on their bugtracker...
I finally figured this out. For whatever reason, there was an entry for java.util.Optional in the exlusions under Editor, General, and Auto Import.
Removing that did the trick. No idea how or why it ended up being there. Doesn't sound like anything I would want to do.
Stupid IntelliJ.
I have a SpringBoot project which worked just fine. Then, the next day, when I want to run it, I got this error:
Caused by: java.lang.Error: Unresolved compilation problem:
The type java.util.Optional cannot be resolved. It is indirectly referenced from required .class files without changing anything!
I cleared IntelliJ cache.
Although it was a maven project it was already using JDK8,
I have changed the Project Settings, and said (again) to use JDK8,
Maven re-import, Cleaned the project, Build->Rebuild project, and it magically worked again
I had a similar problem in ubuntu. For me the problem was that I used JDK1.7 and when I changed it to JDK1.8 everything worked just fine.
Now, that makes sense, as Optional is something that was introduced in JDK1.8, before that the concept was exists only in Guava: http://onelineatatime.io/optional-guava-and-java-8/
Ran into the same problem (in IntelliJ 2017.2.7) and solved it like this:
Project Structure->Modules->Module SDK and there change it to 1.8
I've also first set Java compiler to 8 and Project Structure->Project->Project SDK and Project language level also set to 8 without success. In the end, the step I described finally fixed it.
I ran into this recently. The issue was related to my Project SDK setting. Didn't have to clear any caches.
The issue shows with my Project SDK set to 1.8 (1.8.0_202). The issue was fixed by changing it to 11 (11.0.6). Also confirmed that the issue reappears when I switched it back to 1.8.
In java 8 some functions of Optional class not supported such as isEmpty, ifPresentOrElse, or, stream, orElseThrow. You should check whether you use them or not. If you want to use these functions you can use java 11.