Skip to content

Maven java project in Intellij IDEA 2019.3, JDK 11.0.3: Cannot resolve symbol ‘java’ but still compile

What I have:

  • Intellij IDEA 2019.3, bundled JDK 11.0.3
  • A Maven project with project JDK: the bundled JDK

    My problem:
    For any java. imports I get the error Cannot resolve symbol ... but I can still compile correctly.

    I’m totally aware that a lot of people already discussed this problem, and of course I have tried all of it:
  • Use the dialog ‘Setup JDK’ a thousand times to set the project JDK again
  • Validate that all modules and the project use the correct language level 11
  • Invalidate Cache / Restart
  • Delete the file <project name>.iml
  • Delete the .idea directory
  • Reimport the whole maven project



The problem is connected with the bundled JDK: I have installed manually another JDK 11.0.4, set it as project JDK and now it works

User contributions licensed under: CC BY-SA
2 People found this is helpful