Can anyone make the following run?
public class ExecTest {
public static void main(String[] args) {
try {
//Notice the multiple spaces in the arg
Simple way to resolve this problem for files is java.awt.Desktop Since 1.6 Example:
Desktop.getDesktop().open(new File(fullFileName));
Could be a Java bug. See: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6511002
Did a bit of debugging out of curiosity, I think things are becoming unstuck in java.lang.ProcessImpl (see the constructor). Noticed that when it got to actually calling the underlying Windows API the string had turned into
explorer.exe "/select,"c:\New Folder\test.txt""
So that might explain why, as for workarounds see the bug database link.