Netbeans says newly created file already exists, file is blank
netbeans
Solution
I had similar experience: Every time I right clicked in Netbeans 8 to get a new Class in a package I only got a empty file and a complaint about that the file already exist.
The solution was for me to go to Tools -> Templates -> expand Java folder -> select "Java Class" -> press "Revert to Default"
Problem
Ok, so, using Netbeans for a small Java project. Anyway, it was working fine this morning. Then, after working on another project briefly and switching back, something changed. Now, when I create new .java files, it says they already exist - but, they didn't, until then. That is, the filename didn't exist, and once I made it, it said it already exists, which, after it says that, it does. Which, well, the file didn't exist before, so it is a problem. Secondly, the file it creates is blank. It is much easier to use when it creates it using the template: automatically adding the package statement, and class structure. This persists across a restart. Sounds similar to this: Netbeans creates file, then complains it already exists On Windows 7. Netbeans version 7.3 Any ideas how to fix? EDIT: I think I may have found the cause. I had changed the default class template, or more accurately, took a few sections out of the default. Apparently the second time I did it, I also erased a bit of the template markup, and it was this syntax error that ended up making this happen. After fixing the syntax error, it seems to work.