I have two java applications:
For the time, I start both applications in differents processes.
How could I start the server from the client to obtain a "standalone" application? The use of ProcessBuilder
to call java.exe
is a solution, but it has drawbacks: it will be OS dependant and cannot assure the server process will be shutdown / killed as the client leaves.
I found a solution in https://www.toptal.com/spring-boot/spring-boot-application-programmatic-launch . Igor Delac
...loader.archive.JarFileArchive
(and some other)The jar file is not extracted nor modified. Only a few classes are read.