本文介绍了IntelliJ IDEA 中的自动错误检测的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Java 编程语言和 IntelliJ IDEA 2017.1 IDE 的新手.

我刚刚安装了 IDE 并激活了所有各种检查,但 IDE 无法在我犯错误(例如省略括号或分号)时检测到错误.

此图像显示已激活的检查:

这是我的代码的屏幕截图,其中包含多个错误,但 IDE 未检测到:

请帮我解决这个问题.

解决方案

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):

这篇关于IntelliJ IDEA 中的自动错误检测的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-26 20:38
查看更多