Java的Runtime.getRuntime()。exec()会在Windows 7上运行吗? [英] would Java's Runtime.getRuntime().exec() run on windows 7?
问题描述
我有windows xp并开发了一些java swing应用程序。
在我的程序中我正在使用
i have windows xp and developing some java swing application.
In my program i am using
运行时。 getRuntime()。exec(rundll32 SHELL32.DLL,ShellExec_RunDLL+ myfile);
打开我在Windows程序中生成的文件默认编辑器。
to open the file produced from my program in windows default editor.
它在我的系统上运行正常。我只是想知道它在Windows 7上是否正常工作。
Windows 7中的流程执行是否有任何安全方面,而这些方面没有出现在Windows XP中?
It works fine on my system. I just want to know would it work OK on windows 7.
Are there any security aspects to this process execution in windows 7 which does not show up in windows XP?
推荐答案
不是直接答案,但你应该使用 桌面#open()
独立于平台。
Not a direct answer, but you're supposed to use Desktop#open()
for this to be platform independent.
Desktop.getDesktop().open(file);
这篇关于Java的Runtime.getRuntime()。exec()会在Windows 7上运行吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!