aspose file tools*
The moose likes Beginning Java and the fly likes A question about copy of a File/jar which is running in jvm. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "A question about copy of a File/jar which is running in jvm." Watch "A question about copy of a File/jar which is running in jvm." New topic
Author

A question about copy of a File/jar which is running in jvm.

lei feng
Greenhorn

Joined: Aug 23, 2007
Posts: 26
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.

this is the copy code i used.

Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

(sorry, this is not related to your question, but could you check your private messages ? )


[My Blog]
All roads lead to JavaRanch
 
 
subject: A question about copy of a File/jar which is running in jvm.