Compiling Projects in IntelliJ IDEA
By default, IntelliJ IDEA compiles files on demand that is when you run the application or explicitly invoke the Make action. The rationale behind this choice is to preserve system resources for other tasks that can be more important at the moment.
The compilation in IntelliJ occurs through javac but the entire process is still guaranteed to incremental and then as fast as possible. IntelliJ IDEA, in fact, keeps track of the dependencies existing between source files and recompiles only files that have been modified. Files with compilation errors are highlighted, and so are the folders where such files are contained.
To see a list of all files with compilation errors, from the drop-down list at the top of the project explorer window you select Problems, as shown below.
Note that IntelliJ IDEA constantly performs background code analysis on files with errors and removes the red highlighting automatically as soon as you fix errors.
Compiling on Every Save
A feature of Eclipse that sometimes developers seem to miss in IntelliJ IDEA is compilation on every save. This feature does exist in IntelliJ IDEA, except that it is disabled by default. You can enable it from the Settings dialog box, under the Compiler tab. All you do is checking the Make project automatically option.
Compiling Code with Errors
IntelliJ IDEA also bundles ECJ. You can instruct IntelliJ to use ECJ instead of javac from the Settings dialog.
Once you have selected the Eclipse compiler to compile your code, you can also enable compilation with errors in IntelliJ IDEA. You just check the Proceed on errors option for the Eclipse compiler.