Results 1 to 3 of 3

Thread: 11.10 not supporting java.awt.Desktop API

  1. #1
    Join Date
    Feb 2008
    Beans
    34

    11.10 not supporting java.awt.Desktop API

    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.

  2. #2
    Join Date
    Feb 2008
    Beans
    34

    Re: 11.10 not supporting java.awt.Desktop API

    Just for closure, this resolved itself. No clue as to what changed.

  3. #3
    Join Date
    Jul 2007
    Location
    Stanford, CA USA
    Beans
    99
    Distro
    Ubuntu 12.04 Precise Pangolin

    Lightbulb Re: 11.10 not supporting java.awt.Desktop API

    I just had a similar problem (but on 12.04, 64-bit) and solved it by installing libgnome2-0. Apparently, according to the documentation documentation of the desktop API, it looks for "gnome libraries". I found the solution here. I'm not 100% positive that it was just libgnome2-0 that fixed it, but either that or the associated packages did. When installing it through aptitude I ended up getting
    Code:
    The following NEW packages will be installed:
      libbonobo2-0{a} libbonobo2-common{a} libgnome2-0 libgnomevfs2-0{a} libgnomevfs2-common{a}
    iceback, I know your problem was already solved but this was one of the few threads I found when trying to debug this for myself. Maybe this will help someone!
    Last edited by ackey; August 17th, 2012 at 05:19 AM.
    Toshiba NB505 (2011): Ubuntu 11.04
    System76 DarU2 (2007): Ubuntu 11.10
    Custom Desktop (2005): Ubuntu 11.10
    Dell quad-core Workstation: Ubuntu 12.04

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •