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...
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!
Although it was a maven project it was already using JDK8,
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.
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