This discussion is archived
2 Replies Latest reply: Oct 4, 2010 10:07 AM by 802471 RSS

Desktop Failed to open file:

802471 Newbie
Currently Being Moderated

I'm having trouble with java opening a .mpg file using I keep getting this error:
Exception in thread "main" 
Failed to open file:/C:/Users/user/Desktop/01-entrance-lobby.mpg. 
Error message: No application is associated with the specified file for this operation.

        at SSCE.main(
Java Result: 1
Even the SSCE has failed:
public class SSCE {

    * @param args the command line arguments
    public static void main(String args[]) throws Exception {
        File f = new File("C:\\Users\\user\\Desktop\\01-entrance-lobby.mpg");
        System.out.println("file exist: " + f.exists());

I've made sure that the file has an associated program to open it. I'm using JDK 1.6.0 Update 21. I've tried it using a .png file and it works but a .pdf file fails. Any help on this is much appreciated. Thanks.


Edited by: vpy on Oct 4, 2010 9:04 AM


  • Correct Answers - 10 points
  • Helpful Answers - 5 points