Since I cannot find other references to this problem I have to assume it's a configuration problem. The problem is that Desktop API in not functional.
I have a pretty vanilla ubuntu-11.10 (64 bit) install and I'm running the default GNOME (Unity?) window manager. Though I have to admit I've added a fair number of packages hoping one will restore what I think should be normal behaviour.
Linux am-rjs 3.0.0-16-generic #28-Ubuntu SMP Fri Jan 27 17:44:39 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
Java(TM) SE Runtime Environment (build 1.6.0_31-b04)
Code:
public class DesktopInvoke {
public static void main(String [] args) {
Desktop dt = Desktop.getDesktop();
if (dt.isDesktopSupported() ) {
System.out.println("Should work fine");
}
else {
System.out.println("You're hosed");
}
}
}
And running this I get
Code:
java -cp . DesktopInvoke
Exception in thread "main" java.lang.UnsupportedOperationException: Desktop API is not supported on the current platform
at java.awt.Desktop.getDesktop(Desktop.java:126)
at DesktopInvoke.main(DesktopInvoke.java:5)
Sure, it's not well crafted but the point I think is made. WTF.
Bookmarks