How can I restart a Java application?

Of course it is possible to restart a Java application. The following method shows a way to restart a Java application: public void restartApplication() { final String javaBin = System.getProperty(“java.home”) + File.separator + “bin” + File.separator + “java”; final File currentJar = new File(MyClassInTheJar.class.getProtectionDomain().getCodeSource().getLocation().toURI()); /* is it a jar file? */ if(!currentJar.getName().endsWith(“.jar”)) return; /* Build … Read more