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

B

Bernd Eggink

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
 
L

Lars Enderin

Bernd said:
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.
 
B

Bernd Eggink

Lars said:
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
 
B

Bernd Eggink

Bernd said:
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
 
A

Arved Sandstrom

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
 
B

Bernd Eggink

Arved said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top