TL;DR: First java application launches second java application, but only after exiting itself.
I've got two executable jar files (exported from eclipse). I'm starting the first one through command prompt with the "java -jar first.jar" command. Part of what this jar does is starting the second jar. I've tried both of the following:
ProcessBuilder pb = new ProcessBuilder("java", "-jar", "Second.jar");
Process p = pb.start();
and
Runtime.getRuntime().exec("java -jar Second.jar");
Now, when I run a small test jar as second.jar, there's no issue. However, for my purposes the second jar is substantially larger (using JavaFX, JDBC connectors, JXBrowser components and launching an external process itself). When I replace the simpler second.jar with this one, something odd happens. For all intents and purposes nothing seems to happen, but only as long as first.jar is running. As soon as it's done its work and exited, or if its process is killed, second.jar launches perfectly. I'm not sure what's doing this so I don't know what to try. I'm using log4j2 and according to the logs, the entry into the main method of second.jar doesn't happen until after the first.jar has closed.
TL;DR