Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Auto errors detection in IntelliJ IDEA

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:

Activated Inspections

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

Kindly help me solve this problem.

like image 777
Prince Lionel N'zi Avatar asked Apr 09 '17 13:04

Prince Lionel N'zi


People also ask

How do I enable auto completion in IntelliJ?

By default, IntelliJ IDEA displays the code completion popup automatically as you type. If automatic completion is disabled, press Ctrl+Shift+Space or choose Code | Code Completion | Type-Matching from the main menu. If necessary, press Ctrl+Shift+Space once again.

Why my IntelliJ is not showing errors?

To access this Problems panel, you must set your project to build automatically. Check the box for Preferences / Settings > Build, Execution, Deployment > Compiler > Build project automatically .


2 Answers

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

java project

source root

like image 180
CrazyCoder Avatar answered Oct 23 '22 08:10

CrazyCoder


One more reason could be IntelliJ is running on power saver mode, this could be disabled following way:

File Menu -> Power Saver Mode

like image 36
Govinda Sakhare Avatar answered Oct 23 '22 06:10

Govinda Sakhare