Enable Partial Compilation in IntelliJ IDEA

前端 未结 5 1719
名媛妹妹
名媛妹妹 2020-11-28 07:47

How do I enable partial compiles in IntelliJ?

The same feature in NetBeans where by one can run a main method in a class without having non-dependecies in the same

5条回答
  •  天涯浪人
    2020-11-28 08:49

    IntelliJ IDEA doesn't welcome working on the project that fails to compile, but there are several options:

    • use Compile action from the file/folder context menu, disable Build in Run/Debug configuration.
    • in the Before launch section of the Run/Debug configuration remove Build and add Build, no error check instead. Now start the configuration and it will ignore compilation errors trying to run on whatever classes managed to compile.

    You should note that Make will fail on the first error and will not try to proceed further. In this case you should use explicit Compile action. Make also deletes output class files for the sources with errors.

    If you want compilation to proceed after errors, you should switch to Eclipse compiler in IntelliJ IDEA Settings | Compiler | Java Compiler. When Eclipse compiler is selected, Proceed on errors option appears and it's enabled by default. With Eclipse compiler, an option to Proceed on errors enabled and Build, no error check in Before launch section you should get the desired behavior.

提交回复
热议问题