Java6: When are BROWSE and MAIL actions supported on Linux?

Discussion in 'Java' started by Bernd Eggink, Dec 31, 2008.

  1. Bernd Eggink

    Bernd Eggink Guest

    Does anybody know what exactly has to be present on Linux systems to
    make Desktop.isSupported(Desktop.Action.BROWSE) (or MAIL, resp.) return
    true? There appears to be no documentation on this. What I figured out
    so far is that the 'gconf' package is required, and that the information
    is kept in ~/.gconf/desktop/gnome/url-handlers/*.
    On one of my systems, however, the JRE says BROWSE isn't supported
    although gconf ist installed. So some other thing must be missing.

    Thanks for any hints,
    Bernd

    --
    Bernd Eggink
    http://sudrala.de
     
    Bernd Eggink, Dec 31, 2008
    #1
    1. Advertising

  2. Bernd Eggink

    Lars Enderin Guest

    Bernd Eggink wrote:
    > Does anybody know what exactly has to be present on Linux systems to
    > make Desktop.isSupported(Desktop.Action.BROWSE) (or MAIL, resp.) return
    > true? There appears to be no documentation on this. What I figured out
    > so far is that the 'gconf' package is required, and that the information
    > is kept in ~/.gconf/desktop/gnome/url-handlers/*.
    > On one of my systems, however, the JRE says BROWSE isn't supported
    > although gconf ist installed. So some other thing must be missing.
    >


    In my Ubuntu installation, I have

    /sda3/home/enderin/.gconf/desktop/gnome/url-handlers:
    used 32 available 77515304
    drwx------ 8 enderin enderin 4096 2008-08-08 12:03 .
    drwx------ 11 enderin enderin 4096 2008-11-23 18:03 ..
    drwx------ 2 enderin enderin 4096 2008-10-26 01:17 about
    -rw------- 1 enderin enderin 0 2008-07-10 21:54 %gconf.xml
    drwx------ 2 enderin enderin 4096 2008-10-26 01:17 http
    drwx------ 2 enderin enderin 4096 2008-10-26 01:17 https
    drwx------ 2 enderin enderin 4096 2008-07-10 21:54 mailto
    drwx------ 2 enderin enderin 4096 2008-12-31 12:47 rtsp
    drwx------ 2 enderin enderin 4096 2008-10-26 01:17 unknown

    In the http directory, I find %gconf.xml, with the contents:
    <?xml version="1.0"?>
    <gconf>
    <entry name="needs_terminal" mtime="1217950670" type="bool"
    value="false">
    </entry>
    <entry name="command" mtime="1218185892" type="string">
    <stringvalue>firefox -new-tab &quot;%s&quot;</stringvalue>
    </entry>
    </gconf>

    I tried the desktop demo application from
    http://java.sun.com/developer/technicalArticles/J2SE/Desktop/javase6/desktop_api/,
    which worked well on my computer.
     
    Lars Enderin, Dec 31, 2008
    #2
    1. Advertising

  3. Bernd Eggink

    Bernd Eggink Guest

    Lars Enderin schrieb:
    > Bernd Eggink wrote:
    >> Does anybody know what exactly has to be present on Linux systems to
    >> make Desktop.isSupported(Desktop.Action.BROWSE) (or MAIL, resp.)
    >> return true? There appears to be no documentation on this. What I
    >> figured out so far is that the 'gconf' package is required, and that
    >> the information is kept in ~/.gconf/desktop/gnome/url-handlers/*.
    >> On one of my systems, however, the JRE says BROWSE isn't supported
    >> although gconf ist installed. So some other thing must be missing.
    >>

    >
    > In my Ubuntu installation, I have
    >
    > /sda3/home/enderin/.gconf/desktop/gnome/url-handlers:
    > used 32 available 77515304
    > drwx------ 8 enderin enderin 4096 2008-08-08 12:03 .
    > drwx------ 11 enderin enderin 4096 2008-11-23 18:03 ..
    > drwx------ 2 enderin enderin 4096 2008-10-26 01:17 about
    > -rw------- 1 enderin enderin 0 2008-07-10 21:54 %gconf.xml
    > drwx------ 2 enderin enderin 4096 2008-10-26 01:17 http
    > drwx------ 2 enderin enderin 4096 2008-10-26 01:17 https
    > drwx------ 2 enderin enderin 4096 2008-07-10 21:54 mailto
    > drwx------ 2 enderin enderin 4096 2008-12-31 12:47 rtsp
    > drwx------ 2 enderin enderin 4096 2008-10-26 01:17 unknown
    >
    > In the http directory, I find %gconf.xml, with the contents:
    > <?xml version="1.0"?>
    > <gconf>
    > <entry name="needs_terminal" mtime="1217950670" type="bool"
    > value="false">
    > </entry>
    > <entry name="command" mtime="1218185892" type="string">
    > <stringvalue>firefox -new-tab &quot;%s&quot;</stringvalue>
    > </entry>
    > </gconf>


    I have all this on the system I mentioned, but nevertheless it doesn't
    work. It works on two other systems which have a similar configuration,
    but other (additional) libraries installed. The question is, which of
    the several hundred libraries is the crucial one; or better: Where is a
    documentation that clearly defines the prerequisites JRE 6 expects on Linux?

    Bernd

    --
    Bernd Eggink
    http://sudrala.de
     
    Bernd Eggink, Dec 31, 2008
    #3
  4. Bernd Eggink

    Bernd Eggink Guest

    Bernd Eggink schrieb:
    > Does anybody know what exactly has to be present on Linux systems to
    > make Desktop.isSupported(Desktop.Action.BROWSE) (or MAIL, resp.) return
    > true? There appears to be no documentation on this. What I figured out
    > so far is that the 'gconf' package is required, and that the information
    > is kept in ~/.gconf/desktop/gnome/url-handlers/*.
    > On one of my systems, however, the JRE says BROWSE isn't supported
    > although gconf ist installed. So some other thing must be missing.


    OK, I found it, by trial and error. The 'avahi' library from gnome was
    missing.

    I also found this "technical article":

    http://java.sun.com/developer/technicalArticles/J2SE/Desktop/javase6/desktop_api/

    which says: "On the Solaris Operating System and the Linux platform,
    this API is dependent on Gnome libraries". That's it. Not an overly
    technical article, IMHO...

    Bernd

    --
    Bernd Eggink
    http://sudrala.de
     
    Bernd Eggink, Dec 31, 2008
    #4
  5. On Wed, 31 Dec 2008 19:04:21 +0100, Bernd Eggink wrote:

    > Bernd Eggink schrieb:
    >> Does anybody know what exactly has to be present on Linux systems to
    >> make Desktop.isSupported(Desktop.Action.BROWSE) (or MAIL, resp.) return
    >> true? There appears to be no documentation on this. What I figured out
    >> so far is that the 'gconf' package is required, and that the
    >> information is kept in ~/.gconf/desktop/gnome/url-handlers/*. On one of
    >> my systems, however, the JRE says BROWSE isn't supported although gconf
    >> ist installed. So some other thing must be missing.

    >
    > OK, I found it, by trial and error. The 'avahi' library from gnome was
    > missing.
    >
    > I also found this "technical article":
    >
    > http://java.sun.com/developer/technicalArticles/J2SE/Desktop/javase6/

    desktop_api/
    >
    > which says: "On the Solaris Operating System and the Linux platform,
    > this API is dependent on Gnome libraries". That's it. Not an overly
    > technical article, IMHO...
    >
    > Bernd


    I have to agree that the docs are bad...well, non-existent. If I run a
    simple program to tell me what the Desktop API thinks is supported on my
    Ubuntu box, I find that BROWSE, MAIL and OPEN are OK, and PRINT and EDIT
    are not.

    I also know that *if* gconf is involved, the Desktop API is not
    necessarily looking at '~/.gconf/desktop/gnome/url-handlers/*', because I
    don't have that last directory at all. Another gentleman suggested it had
    something to do with the %gconf.xml files...maybe on his machine it does
    - on mine every one of those files is 0-length. I also saw a suggestion
    that it had to do with specific directories in '~/.gconf/desktop/gnome/
    applications', like for 'browser'...perhaps, but the only directory I
    have in that path is for 'window_manager'. In fact, my application
    references appear to be confined to '~/.gconf/apps'.

    So who knows what the Desktop API looks for. You can't (readily) get the
    source for JDK 6 anymore to investigate, and while I have the source for
    JDK 7, and did take a quick peek in the native code, I'm not going to
    waste my time trying to find out by code inspection what Sun does.

    All I know is, I have gedit, and if this API can't pick that up for EDIT,
    the boys had better go back to the drawing boards...

    Sun cannot expect people to adopt this API if there are such problems,
    and such lack of documentation. How tough would it be to inform people,
    that in order to enable option PRINT on Linux, all you need to do is
    this? Not very...presumably Sun already knows what their code is looking
    for.

    AHS
     
    Arved Sandstrom, Jan 1, 2009
    #5
  6. Bernd Eggink

    Bernd Eggink Guest

    Arved Sandstrom schrieb:
    > On Wed, 31 Dec 2008 19:04:21 +0100, Bernd Eggink wrote:
    >
    >> Bernd Eggink schrieb:
    >>> Does anybody know what exactly has to be present on Linux systems to
    >>> make Desktop.isSupported(Desktop.Action.BROWSE) (or MAIL, resp.) return
    >>> true? There appears to be no documentation on this. What I figured out
    >>> so far is that the 'gconf' package is required, and that the
    >>> information is kept in ~/.gconf/desktop/gnome/url-handlers/*. On one of
    >>> my systems, however, the JRE says BROWSE isn't supported although gconf
    >>> ist installed. So some other thing must be missing.

    >> OK, I found it, by trial and error. The 'avahi' library from gnome was
    >> missing.
    >>
    >> I also found this "technical article":
    >>
    >> http://java.sun.com/developer/technicalArticles/J2SE/Desktop/javase6/

    > desktop_api/
    >> which says: "On the Solaris Operating System and the Linux platform,
    >> this API is dependent on Gnome libraries". That's it. Not an overly
    >> technical article, IMHO...
    >>
    >> Bernd

    >
    > I have to agree that the docs are bad...well, non-existent. If I run a
    > simple program to tell me what the Desktop API thinks is supported on my
    > Ubuntu box, I find that BROWSE, MAIL and OPEN are OK, and PRINT and EDIT
    > are not.
    >
    > I also know that *if* gconf is involved, the Desktop API is not
    > necessarily looking at '~/.gconf/desktop/gnome/url-handlers/*', because I
    > don't have that last directory at all. Another gentleman suggested it had
    > something to do with the %gconf.xml files...maybe on his machine it does
    > - on mine every one of those files is 0-length. I also saw a suggestion
    > that it had to do with specific directories in '~/.gconf/desktop/gnome/
    > applications', like for 'browser'...perhaps, but the only directory I
    > have in that path is for 'window_manager'. In fact, my application
    > references appear to be confined to '~/.gconf/apps'.


    On my system (Crux, non-gnome) it clearly depends on the files in
    ~/.gconf/desktop/gnome/url-handlers/{http,https,mailto,...}, not on the
    apps branch. Each of these directories contains a file %gconf.xml
    containing the relevant information. For example, the content of the
    http file is

    --------------------------------------------------------------------
    <?xml version="1.0"?>
    <gconf>
    <entry name="needs_terminal" mtime="1219420034" type="bool"
    value="false">
    </entry>
    <entry name="enabled" mtime="1219420034" type="bool" value="true">
    </entry>
    <entry name="command" mtime="1230481811" type="string">
    <stringvalue>/usr/bin/firefox &quot;%s&quot;</stringvalue>
    </entry>
    </gconf>
    --------------------------------------------------------------------

    The files are generated / changed by using gconftool-2 (not very
    comfortable), by setting the default browser in the system's control
    center (if there is such a thing), or by telling the browser to be the
    standard one.

    I wrote a little shell script which wraps the necessary gconftool-2
    invocations for browser and mail, and can send it to anybody who is
    interested.

    Regards,
    Bernd

    --
    Bernd Eggink
    http://sudrala.de
     
    Bernd Eggink, Jan 1, 2009
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Timasmith
    Replies:
    0
    Views:
    338
    Timasmith
    Nov 13, 2006
  2. Hendrik Maryns

    Confused: Java6 32-bit vs. 64-bit

    Hendrik Maryns, May 2, 2007, in forum: Java
    Replies:
    3
    Views:
    592
    Tom Hawtin
    May 2, 2007
  3. =?Utf-8?B?QU5lZWxpbWE=?=
    Replies:
    1
    Views:
    373
    bruce barker
    Oct 1, 2007
  4. Replies:
    2
    Views:
    559
  5. Replies:
    0
    Views:
    239
Loading...

Share This Page