Basically there are 3 different JDK configurations
The supplied internal JDK of the IDE - currently a JDK 17 only for the operation of the IDE. This JDK should not be used elsewhere in projects
Various possible JDKs that can be added to the IDE globally. Only one of them can be used as a global JDK for projects that do not have their own JDK defined for them.
Each project can define its own JDK from among the JDKs already added to the IDE for itself
In principle, a JDK should always be selected directly for the project at project start either automatically via the global IDE JDK or specifically defined in the project.
Define for the project via: Right click on the project → Properties → Java Build Path → Libraries.
Cause is mostly due to Maven and an error while building the project. What errors can occur:
Missing internet connection during maven build
Repository server is unreachable
Error in the POM.xml
In most cases, a fresh Maven update will help over:
Right click on the project → Maven → Update project.
In severe cases the option "Force Update of Snapshot/Releases" can be selected
All ever loaded repositories are cached in the user home in the ".m2" directory. Over time, quite a lot of data is accumulated here and in very severe cases it may also
help to delete this directory once completely.
Mostly these are classes which are related to the entities in the project, have the same name and an underscore at the end.
These classes are built during the project build via the so-called "Annotation Processing". If this is deactivated, these errors can occur.
You can enable "Annotation Processing" globally via Windows → Preferences → Maven → Annotation Processing or in the project via Right click on the project → Properties → Maven → Annotation Processing.
Then perform a Maven update