我有一个 JNLP 文件,通常我会使用控制台(Linux)执行并且工作完美。
javaws launch.jnlp
但现在我必须从 Java 代码运行,我尝试了这个...
Process p = Runtime.getRuntime().exec(new String[]{"path/to/.jnlp"});
p.waitFor();
不工作,因为它应该运行。
最佳答案
the.jnlp
位于 user.home
中,简单如下:
File f = new File(System.getProperty("user.home"));
f = new File(f, "the.jnlp");
Desktop.getDesktop().open(f); // Launches the associated application to open the file.
关于java - 如何使用 Java 运行 jnlp 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37798858/