poublic void openFile(String filePath){
if (osName.equals("Linux")) {
try {
Runtime.getRuntime().exec("gedit " + filePath);
} catch (IOException ex) {
Exceptions.printStackTrace(ex);
}
} else {
Process process;
final String cmd = "rundll32 url.dll FileProtocolHandler file://" + filePath;//要打开的文件路径。
try {
process = Runtime.getRuntime().exec(cmd);
} catch (IOException e) {
Msg("Error exec!");
}
}
}