Posted by kgrucci
on March 3, 2008 at 10:08 AM PST
While unsuccessfully searching for a switch to turn off auto compilation within Netbeans, I did find a way to limit it (through the GUI).
Earlier today, I was working with a java source file in Netbeans 6.0.1. The file is part of a very large project which I had opened in the IDE. Everything had been working fine until I decided that I needed to make a copy of the file I was editing (to try something out). I chose "Save as" from the File menu within Netbeans and saved the file to a new name in a different package (within the same project). At this point, Netbeans decided to recompile the entire project. This process bogged down the entire application to the point where even simple actions (such as selecting a menu item) took 5+ seconds.
After searching the Netbeans options as well as the internet for a way to turn off auto compilation within the IDE (with no success), I did stumble upon a way to include/exclude certain sources from being auto-compiled. To do this, right-click the project you want to affect (in the projects tab), and select "properties". Then click the "includes/excludes" button in the bottom right corner of the dialog. The dialog that comes up will allow you to explicitly include and/or exclude sources within your project from being auto-compiled. The next time I added a file to the project, the auto-compile took only seconds since I had only included the sources that I am responsible for. See this Netbeans wiki entry for more info.