// 运行cmd命令执行程序
Runtime runtime = Runtime.getRuntime();
runtime.exec("cmd /c " + file.getAbsolutePath());
// runtime.exec("cmd /c " + "E:\\表情包\\01.jpg");
file.getAbsolutePath就是你要打开的文件或程序的绝对路径。
// 运行cmd命令执行程序
Runtime runtime = Runtime.getRuntime();
runtime.exec("cmd /c " + file.getAbsolutePath());
// runtime.exec("cmd /c " + "E:\\表情包\\01.jpg");
file.getAbsolutePath就是你要打开的文件或程序的绝对路径。