2

Possible Duplicate:
Any way to “reboot” the JVM?

Is there any option to restart currently executing .jar(a complete project),by code from inside that program

Community
  • 1
  • 1
Anil Olakkal
  • 3,734
  • 2
  • 17
  • 17

1 Answers1

5

You can invoke using Runtime.getRuntime().exec()

java -jar yourJar.jar

and immediately you can invoke

System.exit(0);

So launching new instance and stopping current

jmj
  • 237,923
  • 42
  • 401
  • 438