how to restart java application, remembering its command line arguments

后端 未结 5 478
一整个雨季
一整个雨季 2021-01-14 03:07

I have a java application. It can be started with couple of command line flags. I want to provide ability \"restart\" the application by user.

Currently we save the

5条回答
  •  梦毁少年i
    2021-01-14 03:55

    It varies according to an OS of the user, If you really want to do it OS cross-platform compatible. Then you should supplied starting scripts : shell for linux like OS / bat for windows, these scripts set up the classpath and arguments.

    I don't think that creating "restart" button in the application is a wise decision, but If you want something like "eclipse restart", you should take a look at RuntimeMXBean which can get booting classpath for you.

提交回复
热议问题