启动tomcat时打开本地文件

启动tomcat时打开本地文件

File file = new File("temp.html");
Runtime ce=Runtime.getRuntime();
//输出路径
System.out.println(file.getAbsolutePath());
//执行本地html文件
ce.exec("cmd   /c   start  "+file.getAbsolutePath());
//强制退出
System.exit(0);


猜你喜欢

转载自blog.csdn.net/u012248761/article/details/53289144