Desktop.open() and java.io.IOException

Apr 11, 2011   #java  #swing 

Trying to open a file with java.awt.Desktop.open() sometimes results in a java.io.IOException with the error message: Parameter is incorrect. This is a Java Bug. As a workaround you can call

Runtime.getRuntime().exec("rundll32 SHELL32.DLL,ShellExec_RunDLL " + file);

instead on Windows systems.