Overwrite a jar while in use - Java -


i have jar client has auto updater built in, when open if there new version download it. made downloads new version same directory user running current 1 it's easy end user.

the problem can't overwrite because it's in use obviously. of right downloads new version , have version in name downloads new 1 v1.1 or v1.2 in jar name.

this works seems messy in opinion, know of way make can have same file name? ie know of way overwrite file that's in use, or work around close current , replace reopen new one?

here downloader class - http://pastebin.com/kjddndhh

i think best solution problem not have 1 jar file both manage application , updater. have separate jar updating , current 1 act application alone.

this seems similar how many applications auto updating works.

league of legends has separate updater runs before main application launches

antivirus loads signature files memory , close connection them allowing them overwrite files.


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -