Tag: application restart

重启自己 – 我可以从头开始重新初始化一切吗?

我有这样的事情: public static final String path; static { path = loadProperties(“config.conf”).getProperty(“path”); } public static void main(String… args) { // … do stuff (starting threads that reads the final path variable) // someone want’s to update the path (in the config.conf file) restart(); // ??? } 我想重新初始化JVM再次调用静态初始化程序,然后是main(…) ! 可以吗?