Why do I have to run 'rebuild project' for every change in Intellij?

Viewed 4619

For any change I made to my class, which contains a main() method, I have to run "Build->rebuild project", to make the changes effective. I am afraid my environment or settings have a problem.

Please help.

3 Answers

I think you'll have to repeat this for every JUnit test case.

To alter the behaviour for all test cases:

  1. Run -> Edit Configurations...

  2. In left-hand column, select Templates -> JUnit

    Select Templates here

  3. Make your changes

  4. Hit OK

I had the same problem and I solved it setting the SDK. You need to go in Project Setting and select the Project tab, as show below

Then you can download a JDK or add a new SDK. Finally, you click on OK and run the code.

enter image description here

Related