Why is my program creating empty .lck files?

java, lockfile, logging

Solution

`.lck` is used by the handler(file handler) to lock the file in order to delete this file. You need to close the Handler that is associated with that logger object before you close your program.

Here is sample lines how you can close associated handler:

for(Handler h:log.getHandlers())
{
    h.close();   //must call h.close or a .LCK file will remain.
}

Problem

I am trying to use Java Logger. I get my logger file (name.log) with the content, it works and I also get an empty `name.log.lck` file. Why does this file appear, what program is creating them and how I can remove this behavior?

Original source