How do I configure IntelliJ 13 to show all compile errors in my Java project?

Hi,

I am currently using IntelliJ 13 and I am working on a multi Maven module Java project. Unfortunatelly IntelliJ does not show me all compile errors in Java classes before I explicitly open the according classes containing those compile errors. As soon as I open an erroneous file, the Problems view lists this file (which it did not before opening it!) and the file changes its color in the Projects view.
But honestly I would like my IDE to advise me about errors in my code. I don't want to have to search my erroneous class files.

I have the following questions:

  • Is there a possibility to configure IntelliJ to determine directly after changing anything in one Java class if that change has any impact on other classes in my Java project?
  • What do I have to do to automatically remove invalid (not unused) import statements in Java classes? The action "optimize imports" just removes unused imports, but invalid imports are not removed.


I have already tried to run "make" (Ctrl + F9), but that just reveals a part of the compile errors. The Problems view does not list all files that contain errors.
I also found out about the possibility in the Compiler settings to "Make project automatically", but that also did not help.

What else can I do? Thank you very much for your help in advance.

Regards
Markus

2 comments
Comment actions Permalink

Hello.

Please try Settings / ... / Compiler / Compile independent modules in parallel = Yes. It has just helped me in my test project.

However, it's really a question, should this setting be necessary. I'll anyway pass this case to the responsible developer.

Regards,
Alexander.

0
Comment actions Permalink

Hi Markus,

Concerning "all errors in the project on compilation" question: this behaviour depends on compiler. You cannot achieve this with javac, because it won't generate bytecode for java files with errors, so sooner or later it won't be able to compile another class, that references the "problematic" class. Because of this javac (and IDEA as well) stops compilation if some errors were already reported.
You can configure IDEA (Setting | Compiler | Java compiler) to use eclipse compiler (ecj batch compiler) with the option "Proceed on errors". Combined with "automatic make" feature it will report all compilation errors found in the project.

As for "optimize imports behavior": it is not clear in this case whether those imports are obsolete and could be safely removed, or the imports are not obsolete, but some dependencies are missing and the right fix will be configuring dependencies properly. If "optimize imports" removed those unresolved imports, it would hide the problem instead of fixing it.

Regards,
  Eugene.

1

Please sign in to leave a comment.