I have created an application, in which based on an operation, it modifies the properties file inside the jar.
I’m able to create a new temp jar with the updated changes. But can’t rename the jar file to the existing jar file name. Since it is running, I am not able to delete and rename it.
Can any one suggest any operations or suggestions to delete the jar (Currently Executing) and rename the temp jar to that name?
I have doing for the Application:
http://java.net/projects_tags/jeazyprops
May be you would need to write a custom class loader(extending ClassLoader) which enables you to load/unload the jar. You should be able to delete the jar if you can unload the jar.
Useful links
http://docs.oracle.com/javase/tutorial/deployment/jar/jarclassloader.html
Can I dynamically unload and reload (other versions of the same) JAR?