Java: How do I start a standalone application from the current one when both are in the same package?

前端 未结 3 1045
面向向阳花
面向向阳花 2020-11-22 09:33

This seems like it should be easy, so I must be missing something obvious: I have 4 standalone applications in the same package, us.glenedwards.myPackage,

  • myC
3条回答
  •  北海茫月
    2020-11-22 10:05

    have you tried this?

    Runtime.getRuntime().exec("myClass1 [args]"); //put all args as you used in command
    

    Also, handle/catch the exceptions, as needed.

提交回复
热议问题