Home>Article>Java> IDEA compiles java and prompts that the symbol cannot be found

IDEA compiles java and prompts that the symbol cannot be found

王林
王林 Original
2019-11-19 09:56:17 68875browse

IDEA compiles java and prompts that the symbol cannot be found

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:

IDEA compiles java and prompts that the symbol cannot be found

Maven-Reimport

IDEA compiles java and prompts that the symbol cannot be found

UTF-8

Encoding selection is set to UTF-8, do not use the default configuration:

IDEA compiles java and prompts that the symbol cannot be found

Invalidate Caches and Restart

Restart idea and try it

IDEA compiles java and prompts that the symbol cannot be found

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.

IDEA compiles java and prompts that the symbol cannot be found

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn