Stupid IntelliJ.
I have a SpringBoot project that 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 Caused by: java.lang.Error: Unresolved compilation problem: The type java.util.Optional cannot be resolved. It is indirectly referenced from required.class files Caused by: java.lang.Error: Unresolved compilation problem: The type java.util.Optional cannot be resolved. It is indirectly referenced from required.class files 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 the IntelliJ cache.
Although it was a Maven project, it already used JDK8,
- I changed the project settings and said (again) to use JDK8,
- Re-import Maven, Clean up the project, Build-> Rebuild the project, and it again magically works
source share