eclipse - Rewrite a file in use in java -


i play @ minecraft (famous java games), want rewrite jar file minecraft using (replace 1.7.10-optifine_hd_u_d6.jar other 1.7.10-optifine_hd_u_d6.jar) when minecraft running , whitout closing minecraft test code, file not delete because minecraft using it. https://hastebin.com/iwuxiyokuy.cpp (i put code in code of minecraft, thought if minecraft sleeping, not considered file in use) but, tried ideas , found this: in eclipse can rewrite 1.7.10-optifine_hd_u_d6.jar without closing minecraft (like http://hpics.li/4971e5f)

so, how can rewrite, in java, 1.7.10-optifine_hd_u_d6.jar eclipse when minecraft running , without closing minecraft ?

have nice day !

(sorry bad english i'm young , i'm french :/)

the problem operating system (windows in case) locks file because being used minecraft (java). there nothing can in java work around limitation.

the dialog says file exists warning eclipse don't overwrite existing/the wrong file accident; has nothing operating system locking file.

out of curiosity, why want replace file while minecraft running? why not close minecraft, replace file , start minecraft again? highly doubt minecraft load file after has been loaded @ startup.

edit 1: should do:

file source = new file("path/to/source/file"); file destination = new file("c:/users/victor/appdata/roaming/.minecraft/versions/1.7.10-optifine_hd_u_d6/1.7.10-optifine_hd_u_d6.jar"); try {     files.copy(source.topath(), destination.topath(), standardcopyoption.replace_existing); } catch (ioexception exception) {     exception.printstacktrace(); } 

Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -