Yes, welcome to the Java Ranch. It would help us to help you if you can cut your code down to a much smaller size. For a file opening error, can you get it down to ten lines or so of real code directly relating to the problem?
If a file cannot be deleted it means it is still in use. That can be by an external program, or you may have forgotten to close a Reader, Writer, InputStream or OutputStream for the file.
You can check which process still holds locks on the file using the free tool Process Explorer. Start it up, select Find -> Find Handle or DLL..., type in the name of your file and press Search. You then get a full list of all processes that have a lock on any file that matches your search criteria. If this list is empty after you close the JVM then the problem must be in a remaining open reader, writer or stream.