134

I'm wondering if it is possible to configure IntelliJ Idea to immediately show compile errors on the class files in the project tree. Currently I need to manually trigger the recompilation to see error marks on my classes if the class cannot be compiled.

Paul Brinkley
  • 6,283
  • 3
  • 24
  • 33
magomi
  • 6,599
  • 5
  • 31
  • 38
  • 1
    On the upside, you don't have to save your files for IntelliJ to update the gutter bar for the class you have open :-) It just doesn't update the project tree. – leedm777 Mar 25 '10 at 07:29
  • Can you expand on the feature a bit, because I see the error right away in the project view in IDEA, so I'm not sure if it is there, or if you are asking for something else? – Yishai Mar 25 '10 at 13:31
  • 8
    Short time ago I switched from Eclipse and it had the feature that you see compile errors immediately in the project tree (files get an red underline) - for example if you change the signature of a method you get marked all classes that uses this method with the red line. As joekutner explained there is a plugin that will add this behaviour but as bert answered this plugin seems not work the way expected. By now I think I will live with the base features of IDEA and will change my approach to work with the IDE ;-) – magomi Mar 25 '10 at 22:42
  • 1
    Just for the archive. I've worked with IDEA since then (almost 2 years) after some days I was used to work without this feature and since then I never missed it. – magomi Jan 17 '12 at 19:11
  • 1
    No, the errors don't show up automatically in the Project view. – IgorGanapolsky Dec 28 '12 at 17:40

5 Answers5

126

As of IntelliJ 12 there's an option to automatically build your project upon source changes. In "Settings" --> Build, Execution, Deployment --> "Compiler" check the checkbox "Build project automatically". This will immediately show any compile errors in the project tree.

Steve Chambers
  • 37,270
  • 24
  • 156
  • 208
raymi
  • 1,872
  • 2
  • 20
  • 22
  • 1
    Great improvement for v12. Thanks for adding this to the answers. – Ben Weiss Mar 27 '13 at 10:06
  • 11
    +1 for calling out the option (that is not enabled by default!), but it doesn't seem to show the errors on the files in the project tree as the OP asked. Is there a view of all compiler errors easily viewable at a glance? – Brent Faust May 16 '13 at 19:01
  • @Rubistro View -> Tool Windows -> Problems – Mads Mobæk Jul 05 '13 at 06:12
  • 5
    @MadsMobæk Thanks, but there is no "Problems" view listed in IntelliJ 12.1.4: ![screenshot](http://i.stack.imgur.com/clTcV.png) – Brent Faust Jul 11 '13 at 02:01
  • 2
    Is a similar thing possible for warnings? – Steven Roose Sep 01 '14 at 03:32
  • 4
    It doesn't work when a change creates a compilation error. For instance, when a public method is changed to be private, I have to open the file that calls this method so I see the compilation error for that file. Otherwise, it will only show errors when I rebuild the project. However, it works when there's a compilation problem in a file and then I fix the problem in another file. Example: class A uses a private method of B, then change method of B to public. – Jordan Silva Nov 11 '19 at 11:36
  • 3
    I changed a public class to default and it was being used on 100s of places in my project but build didn't show error at all the places where it was being referenced. If I open a class which has reference then It will be marked as error. Isn't there any option where you can see all the compilation errors? – vermap Dec 09 '19 at 22:20
  • Not working with compilation errors. – Amber Kulkarni Aug 04 '22 at 17:14
20

I did some further searches in the web about this feature. At the end it seems that exactly this feature is not available. There are some discussions about this topic where also some (in my point of view) workarounds are mentioned. The most helpful discussion I found here.

Matt Ball
  • 354,903
  • 100
  • 647
  • 710
magomi
  • 6,599
  • 5
  • 31
  • 38
18

You can access all the compile problems like so:

  • open the "Project" explorer (usually docked on the left)
  • click the "Project" dropdown in the upper left corner
  • select "Problems" under "Scopes"

You'll see a tree of files and problems. Also, on the bottom toolbar, you should see a tab called "Problems" which lists everything as well. It's not as easy to use as the Eclipse "Problems" view, but it's close.

I'm on version 12.1.4, not sure what version this feature first came in, though.

Nathan Beach
  • 2,497
  • 2
  • 24
  • 25
  • 2
    For me the 'Problems' scope showed nothing even though there were a bunch of Java compiler error messages in the 'Messages' tab – Tarmo Nov 10 '17 at 08:16
1

For me, "disabling power safe mode" did the trick.

enter image description here

Sameera De Silva
  • 1,722
  • 1
  • 22
  • 41
0

You might try the Eclipse Mode plugin for IntelliJ. It allows you to do incremental compile upon saving a file:

http://plugins.intellij.net/plugin/?id=3822

codefinger
  • 10,088
  • 7
  • 39
  • 51
  • 7
    I tried that, but as many pointed out it does steal the focus and does not provide the asked feature (e.g. it does not mark the errors in the project tree). I would love to have this feature too, its one of the very things i miss after i switched from eclipse – bert Mar 24 '10 at 21:31