I have three C/C++ projects loaded in Netbeans 21. The Mordaks at Apache have taken off the Set Main Project menu item from right-click project, and hidden it somewhere. Instead, the IDE tries to guess which project you're working on, to run the Hammer, Hammer Broom, and Green run main project buttons at the top, and now it's getting it wrong half the time. What's worse, the guess isn't even sticky--I can be editing the file on one project, and hit Build, and then hit Build again, and it'll sometimes switch the build to a different project. Same thing with Run.
One guess was that if a project is not expanded to show its Source Files folder, then that project would be ignored for the random selection. Nope.
A second guess was that if you're working on a source file that's only contained under one project, then that project would automagically default to the Main Project. Nope.
It looks like the overwrite is currently going to the first project out of three, when I have the third project open and being worked on. It also feels like it might perhaps be a mouse-running-over issue.
Left-clicking on the third project selects the project in blue, and resets the Main properly. Then simply clicking on an already-opened source window from that project turns the selected third project to grey and selects that third-project C++ source window with a blue stripe on top of its tab, but quietly bolluxes the secret Main into the first project. Then when you hit Run, it runs the first project, not the third project. When dealing with live finances, this is completely unacceptable.
Did the Set Main Project functionality get moved to a different menu? How to Set Main Project once and for all, without having to keep clicking on the project every time you want to use the "fast" buttons up top?
I was having the same issue and found that there is another menu that pops up if you right click on the projects pane in the white space below your last project at the bottom of the pane. Photo - Right Click Menu From White Area of Projects List