On Gnome 3 based environments or KDE, the Java Desktop support doesn’t work. How it is an older Java feature, you need to install an old package, from Gnome 2 environment:
[bash]sudo apt-get install libgnome2-0[/bash]
Restart your environment service to apply this new package. The service name will varies according to distribution, such as:
[bash]sudo service lightdm restart[/bash]
[bash]sudo gdm restart[/bash]
Now, resources like Desktop.open(File file) will work.