Turns out the problem had nothing to do with NetBeans or my code. Google Drive was trying to sync the .class files, which meant that NetBeans couldn’t delete them on a new build. Paused Google Drive and everything works. Would be nice if Google Drive let us exclude certain file types, but apparently that’s not an option yet.