简体   繁体   中英

How to restart an application in Java?

Ones my application finishes executing, I need to restart it in order to be able to reuse it again. My application has multiple threads (and some chromedriver.exe issues). Therefore, I prefer NOT to create additional threads in order to restart it. Currently I am simply closing the GUI window and then reopen my application by double clicking on the application.exe file.

I am curious if there is a way I could add an actionListener to a "RESTART" button that would close and reopen my application?

try this code

 Runtime.getRuntime().exec("my App");
 System.exit(0);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM