且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

IntelliJ IDEA中的自动错误检测

更新时间:2022-10-14 23:08:49

Java文件未被分析,因为它位于源根之外。您需要重新定位文件或重新配置




I am new to Java programming language and the IntelliJ IDEA 2017.1 IDE.

I just installed the IDE and I activated all the various inspections but the IDE is unable to detect the errors any time I make a mistake such as omitting a bracket or a semicolon.

This image displays the activated inspections:

This is a screenshot of my code with multiple errors but no detected by the IDE:

Kindly help me solve this problem.

Java file is not analyzed since it's located outside of the source root. You need to either relocate the file or reconfigure your content roots so that it resides under the folder configured as the Sources root.

Sources root is marked in blue in the project view. Here is the example of the properly configured project (notice the class icon is different than on your screenshot):