如何使用自定义应用程序从 Java 程序中打开文件?
Desktop.getDesktop().open(file);
仅使用系统默认应用程序打开文件。我需要的是类似
open(myapp, file);
最佳答案
如果目标应用程序接受文件作为参数打开,那么您可以执行以下操作:
Runtime rt = Runtime.getRuntime();
Process proc = rt.exec("CustomApp "+filename);
关于Java 桌面集成 : open a file with a custom application,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8595727/