1、打开wps、txt
String str[] ={"/bin/sh","-c","wps "+path};
Runtime.getRuntime().exec(str);
2、打开pdf、图片(本人为方便直接用的火狐打开、如果安装其他查看工具,可选择其他工具打开)
String str[] ={"/bin/sh","-c","Firefox"+path};
Runtime.getRuntime().exec(str);
Runtime.getRuntime().exec(str);
Runtime.getRuntime().exec(str);