Sometimes it happens that we need to temporary exclude a file from a project current build. Let's see how to do it in three major IDE: Eclipse, IntelliJ, NetBeans.
To exclude an item from the build, right click on it in the package explorer, select the "Build Path" item, an then "Exclude" it.
It is quite simple to revert the exclusion. Select again "Build Path" for it, now we see that we have a new option available, "Include". Just click on it and the current item is again part of the build.
Access the Settings menu for the project (File, Settings - Ctrl+Alt+S), in the Compiler section access Excludes and there add the file.
Right click on the project name in the Projects navigator, then click on "Properties", and here, in the "Sources" Category, click on the button "Includes/Excludes". By default, in the Includes you seen "**", and the Excludes input line is empty.