IntelliJ IDEA中的自动错误检测 [英] Auto errors detection in IntelliJ IDEA

查看:1962
本文介绍了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中的自动错误检测的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆