Enable partial compilation in IntelliJ IDEA

How to enable partial compilations in IntelliJ?

The same function in NetBeans, where one can run the main method in the class, without requiring compilation of non-dependencies in one project.

EDIT:

After doing what CrazyCoder suggested, with some success, I now get a ClassNotFoundException when I try to run a file that is not associated with those that are not compiling. After fixing files that do not contain compilation, it works fine.

I really made a mistake in the same non-compiling file to check, and it still works.

Maybe this is a mistake?

EDIT:

The following instructions still do not work.

enter image description here

+22
java intellij-idea
May 28 '13 at 5:47
source share
2 answers

IntelliJ IDEA does not welcome work on a project that cannot be compiled, but there are several options:

  • use Compile action from the context menu of the file / folder, disable Make in the Run / Debug configuration.
  • in the section Before starting the Run / Debug configuration, delete Make and add Make, do not check errors . Now run the configuration and it will ignore compilation errors trying to run all the classes that were able to compile.

You should notice that Make will fail on the first error and will not continue to move on. In this case, you must use the explicit Compile action. Also delete the output class files for sources with errors.

If you want the compilation to continue after errors, you must switch to the Eclipse compiler in IntelliJ IDEA Settings | Compiler | Java Compiler When the Eclipse compiler is selected, the Proceed on errors option appears and is enabled by default. With the Eclipse compiler, the Proceed to errors and Do, error checking section is enabled in the section Before you start, you should get the desired behavior.

+51
May 28 '13 at 5:59
source share

To make CrazyCoder's comment more visible, if you go for the "continue by mistake" behavior, you can uncheck

Settings | Compiler | Automatically show first error in editor .

+3
Aug 08 '14 at 10:07 on
source share



All Articles