81,092
社区成员
发帖
与我相关
我的任务
分享
try {
//String path=application.getRealPath("/");
//System.out.println();
//Runtime.getRuntime().exec("cmd.exe /c start "+path+"help.chm");
Desktop desktop = Desktop.getDesktop();
desktop.open(new File("E:\\workplace\\yijian\\WebRoot\\help.chm"));
} catch (Exception e) {
out.println();
}
if (!Desktop.isDesktopSupported()) {
System.out.println("Desktop not supported.");
return;
}
Desktop desktop = Desktop.getDesktop();
File file = new File("D:\\test.chm");
if (file.exists()) {
desktop.open(file);
System.out.println("Done.");
} else {
System.out.println("File not exist.");
}
try {
String path=application.getRealPath("/");
File helpFile = new File(path+"help.chm");
Desktop.getDesktop().open(helpFile);
} catch (Exception e) {
System.out.print("打开帮助文档异常");
}
一样是有问题的