Desktop.getDesktop().browse(new File("c:\\x.pdf").toURI()) just does nothin

On my development machine (XP SP 2, JDK 1.6.0_02), I have written a small program that does this:

java.awt.Desktop.getDesktop().browse(new File("c:\\x.pdf").toURI());

That worked very well for very long time, and the sematically same code from JDIC also worked very well.

Now since a few days, it does not work anymore. There is no exception posted, but the line just does nothing at all. I tried it with other file names and file types -- nothing helped. I even can double click that file in explorer.exe and it correctly opens (not only PDF but all types of files).

So what can be the reason? What can I do? Without an exception I can do pretty nothing to resolve the cause. The program itself seems to be correct. It worked some days before, and it still works on all my other PCs...

Message was edited by:

Markus Karg QUIPSY

[872 byte] By [MarkusKargQUIPSYa] at [2007-11-27 10:22:47]
# 1

hi

have you installed any new anti-virus or any firewall or your OS firewall has turened on? and in that Desktop class there is a method to check whether desktop is supported or not, use that..

regards

Aniruddha

Aniruddha-Herea at 2007-7-28 17:18:05 > top of Java-index,Desktop,Core GUI APIs...
# 2

And what is interesting:

In the same app, just one line below the one written above, I added:

Runtime.getRuntime().exec("cmd.exe /c c:\\x.pdf");

And that works pretty well...

MarkusKargQUIPSYa at 2007-7-28 17:18:05 > top of Java-index,Desktop,Core GUI APIs...
# 3

> have you installed any new anti-virus or any firewall

> or your OS firewall has turened on?

No I did not change anything. Windows Firewall is unchanged since years, also VirusScan software is unchanged.

> and in that

> Desktop class there is a method to check whether

> desktop is supported or not, use that..

public final static void main(final String[] arguments) throws IOException {

System.out.println(java.awt.Desktop.getDesktop().isSupported(java.awt.Desktop.Action.BROWSE)); // prints "true"

java.awt.Desktop.getDesktop().browse(new File("c:\\x.pdf").toURI()); // no reaction

Runtime.getRuntime().exec("cmd.exe /c c:\\x.pdf"); // works pretty well

}

MarkusKargQUIPSYa at 2007-7-28 17:18:05 > top of Java-index,Desktop,Core GUI APIs...
# 4

:( both are working fine for me.

Xp, jdk 6

may be some one else....

Aniruddha-Herea at 2007-7-28 17:18:05 > top of Java-index,Desktop,Core GUI APIs...
# 5

> :( both are working fine for me.

> Xp, jdk 6

I never said it is not working in general.I said, it is NO MORE working on MY PC since a few days without having changed anything. So I think it is a registry problem etc. and need to get some advice by one of the JDIC / AWT authors that invented that code.

MarkusKargQUIPSYa at 2007-7-28 17:18:05 > top of Java-index,Desktop,Core GUI APIs...