2

I have recently switched from IntelliJ IDEA Community Edition version 12, to version 13 (updated to 13.0.1) and apparently the real-time ("on-the-fly") compilation of code does not work, at least not as found in other major IDEs (e.g., Eclipse).

A similar issue has been brought up in an earlier StackOverflow question and the answer was to check the corresponding option in File -> Settings -> Compiler, which I have of course done, but nothing changed.

The way it currently is, I can type whatever text in the Java code and there is no error highlighting, not even when the file is saved, let alone in real time.

Is there another setting or configuration that needs to be applied?

Community
  • 1
  • 1
PNS
  • 19,295
  • 32
  • 96
  • 143
  • Why do you want to compile the files automatically without running them i.e. when you run/debug/profile the files will be compiled. – Peter Lawrey Jan 03 '14 at 20:59
  • 2
    @peterlawrey serious IDEs compile on the fly in the background in order to report compile errors/warnings immediately. – Federico Berasategui Jan 03 '14 at 21:01
  • 1
    It looks like a possible issue in IDEA. Please report it to http://youtrack.jetbrains.com/ and attach your log (Help | Show log) there. – Peter Gromov Jan 03 '14 at 22:51
  • It is really surprising that noone has spotted this yet. Such a feature is fundamental to any IDE-based code development! – PNS Jan 03 '14 at 23:04
  • 1
    @HighCore IntelliJ parses the files its own way so that it can detect many warning,and do things such as layout the code as you type which the compiler doesn't do. This is important because it can do this for code which doesn't compile yet so the compiler isn't good for doing this as it tends to give you error only and much later making them harder to fix. i.e. not as you type. – Peter Lawrey Jan 04 '14 at 09:38
  • As it turns out, a re-importing and recompilation solved the issue (which was module-specific, not project-specific). – PNS Jan 09 '14 at 20:44

2 Answers2

2

IntelliJ does something a lot better than compiling your files on the fly. It dynamically parses what you're typing, offering many more warnings than the java compiler produces. In comparison, compiling on the fly is a bad idea. Having said that, it sounds like you're having other problems, because you should have errors and other problems highlighted. At the top right of each editor window is a small coloured square. On good code it's green. It's yellow when there are warnings, and red when there are errors. If it's grey then Idea is analyzing your files. If you hover your mouse over the square it'll give you an idea about what Idea is doing, and how it's progressing. Try that before you try anything else. Idea never gets stuck, but it can run out of memory, if the analysis isn't progressing, then perhaps you've run out of memory, or have other issues, check this in the event log, which is at the bottom right of the window.

Software Engineer
  • 15,457
  • 7
  • 74
  • 102
  • Thanks for the hint. There is no resource (memory or other) issue. A project created in IntelliJ IDEA 13 does highlight errors as typed, but the project I mentioned in my question (which was originally created in IntelliJ IDEA 12) does not. So it turned out to be an issue of adding the module to the project and recompiling. – PNS Jan 09 '14 at 20:43
1

I've just been pulling my hair out over this working on my Mac in a coffeeshop running on battery power. Try File | Power Save Mode and make sure it's un-checked.

Kent Wood
  • 21
  • 1
  • Thank you so much for that! I hate IntelliJ. The downvote on this answer is unjust! – Yoda May 07 '20 at 15:41