Runtime.getRuntime().addShutdownHook(Thread)为虚拟机添加关闭时添加钩子线程 转载于:https://www.cnblogs.com/jerryshao2015/p/4419627.html