I'm running IntelliJ Ultimate 2022.2.2. For quite some time (and versions) it has been complaining that the Project JDK is misconfigured and giving red lines under basically everything. This wasn't much of a problem aside from being very annoying, because the build configurations and Maven tasks still worked, but now it appears that breakpoints don't work anymore, which is a bit of an issue.
The exact issue is that in the POM, the Java version is set to 11. The JDK is also set to 11, as is the language level. IntelliJ, however, will only remove the warning (and red lines) if the JDK is set to 8 instead. Of course, doing that causes compilation and Maven tasks to fail, because the POM specifies that Java 11 must be used.
As stated above, I tried following IntelliJ's suggestion of changing the JDK to Java 8, which removed the editor warnings and errors, but caused compilation and Maven jobs to fail. Leaving it at 11 compiles and runs just fine, but the editor is filled with errors and warnings and breakpoints don't function.
I've also tried a clean checkout with invalidated caches, but that resulted in the exact same situation.
Why, then, does IntelliJ claim the project JDK is misconfigured, and how can I convince it that it really isn't?
Reload All Maven Projects
in the Maven tool window and provide screenshots fromFile | Project Structure | Project
,File | Project Structure | SDKs | select JDK configured for the project
,File | Project Structure | Modules | select your module | Depenedencies
? – Kirtle