java - Launch another jar at runtime but make the originally launched jar available for deletion -


my scenario is:

i want have main application. it's main being run in usual way, java -jar mainapplication.jar.

that application should able run jar file on file system (e.g. updaterapplication.jar) delete mainapplication.jar , replaced updated new one.

injecting updaterapplication.jar classpath , using reflection not work, because mainapplication.jar still loaded.

how invoke second jar , make first 1 free deletion after second jar has been started?

it fine if second jar had wait first 1 terminate.


Comments