This discussion is archived
6 Replies Latest reply: Dec 11, 2012 11:48 PM by 979024 RSS

Java.Desktop.open() error

979024 Newbie
Currently Being Moderated
Hi, I'm using Java 8 pre-release, and I'm trying to use the java.Desktop.open() method in Win7 X32.
Desktop desktop = Desktop.getDesktop() ;
desktop.open(new File("//Server/Public/file.txt"));
but as long I use this syntax, I obtain runtime Error:
java.io.IOException: Failed to open file:////Server/public/file.txt.
I tried with
desktop.open(new File("\\\\Server\\Public\\file.txt"));
but it produced the same error.
Finally I used a workaround mapping \\Server\Public as X:
desktop.open(new File("X:/file.txt"));
that works.

Legend

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