A question about copy of a File/jar which is running in jvm.
posted 8 years ago
I get a old jar-file running in a jvm and a new jar-file in another folder.I think the old is locked by the jvm. but i can use copy cmd to copy the new file and overwrite this old file.(copy cmd/ctrl+c,ctrl+v). but i can not use cut/paste to finish it(move cmd/ctrl+x,ctrl+v). it will get a error window. if i stop the jvm. i can use the the cut/paste to overwrite the old file. so i'm wondering whether the old file running in jvm is locked. In java, the situtation is same.I use File.renametoFile() i can not overwrite the old-file.But i use some code to copy it, i can overwrite the old file. So I'm pulzzed,i don't know how to explain it.