Reputation: 117
Program A and Program B are both contained in the same src folder.
I've successfully compiled program A in Intellij, but I can't run it. Every time I click "run", it fails to run Program A, saying that an error occurred in Program B, where one line is missing a necessary parentheses. If Program B isn't open in Intellij, it will open the program when being run to tell me there was an error. Obviously I could just add in the parentheses to Program B to successfully run Program A, but shouldn't I be able to run an entirely separate program while other incomplete files are contained within the same folder?
Upvotes: 1
Views: 46
Reputation: 97178
Most real programs consist of multiple source files that depend on each other, and each such group of interdependent source files is normally configured as a separate module in the IDE. Because of that, IntelliJ IDEA compiles each module as a whole, and considers the compilation to be a failure if any files in a module that it needs to run contain compilation errors.
If you have multiple single-file programs that do not depend on each other, you can create separate modules for them in IntelliJ IDEA. Then the ability to run one of them will not depend on compilation errors in other modules.
Upvotes: 1