IDEA runs the main method, why compile the whole project?

Every time after importing a project in IDEA, I want to write a class to test some data, sometimes just write a main method for simple output;

But every time a main method is run, the entire project will be recompiled, which takes a long time

There will be no such problem in Eclipse;

Why does it compile the whole project?

This is the default configuration of an idea;

选择 edit configurtion > Modify Options > before Lauch

insert image description here

Just delete the bulid;
insert image description here

Before the main method needs to be run next time, the class needs to be recompiled;

Select bulid > Recomplole ***

insert image description here
After recompiling, it can be run;


It should be noted that it is valid for some idea versions

Guess you like

Origin blog.csdn.net/weixin_42551921/article/details/127448476