Problem:
This situation occurred when maintaining a new project. When the project was built, it kept reporting an error "xxx package not found", but the referenced package and referenced classes both exist.
Solution:
maven settings
First check the maven settings, do not use the default maven version:
Maven-Reimport
UTF-8
Encoding selection is set to UTF-8, do not use the default configuration:
Invalidate Caches and Restart
Restart idea and try it
Recompile
Select the module that reported the error and right-click. Click 'Build Module' and then start the project again. There is no error message anymore.
Recommended tutorial: Java tutorial
The above is the detailed content of IDEA compiles java and prompts that the symbol cannot be found. For more information, please follow other related articles on the PHP Chinese website!