问题
i have windows xp and developing some java swing application.
In my program i am using
Runtime.getRuntime().exec("rundll32 SHELL32.DLL,ShellExec_RunDLL "+ myfile);
to open the file produced from my program in windows default editor.
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?
回答1:
Not a direct answer, but you're supposed to use Desktop#open() for this to be platform independent.
Desktop.getDesktop().open(file);
来源:https://stackoverflow.com/questions/4571604/would-javas-runtime-getruntime-exec-run-on-windows-7