Java Desktop.browse not supported on Kubuntu 16.04

Bug #1574879 reported by Aere Greenway
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
openjdk-8 (Ubuntu)
Confirmed
Low
Unassigned

Bug Description

The Desktop.browse functionality of Java is not supported on the Kubuntu 16.04 level of the KDE desktop. It was supported in earlier levels.

With this support no longer available, a Java application can no longer activate the system's browser to display the already-installed HTML help files for the application, making the context-sensitive help functionality useless.

Here is the Java code snippet where the code attempts to activate the online help:

        if (Desktop.isDesktopSupported())
        {
            Desktop desktop = Desktop.getDesktop() ;
            if (desktop.isSupported(Desktop.Action.BROWSE))
            {
                try
                {
                    desktop.browse(new URI(url)) ;
                }
                catch (Exception e)
                {
                    String error = "Problem creating URI to access documentation:\n" + e.getMessage() ;
                    reportError(error, true) ;
                }
            }
            else
                reportError("Desktop.browse not supported on this system.", true) ;
        }

When this code is executed, the "Desktop.browse not supported on this system." error message is displayed, rather than activating the user's Internet browser to display the HTML help file already installed in the user's file-system.

In prior releases of Kubuntu, this has always worked. I expected it to work on 16.04 (as it does on the other 'flavors' of Ubuntu 16.04), but it is not supported in the KDE desktop of Kubuntu 16.04

I am using Kubuntu 16.04.

In prior releases of Kubuntu, the online help information was displayed using the system's Internet browser, which was what I expected to happen.

In this release, I instead got the "Desktop.browse not supported on this system." error message, and the Internet browser was not activated to display the already-installed (via Debian package) help information.

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: openjdk-8-jre 8u77-b03-3ubuntu3
ProcVersionSignature: Ubuntu 4.4.0-21.37-generic 4.4.6
Uname: Linux 4.4.0-21-generic x86_64
ApportVersion: 2.20.1-0ubuntu2
Architecture: amd64
CurrentDesktop: KDE
Date: Mon Apr 25 16:12:50 2016
InstallationDate: Installed on 2016-04-22 (3 days ago)
InstallationMedia: Kubuntu 16.04 LTS "Xenial Xerus" - Release amd64 (20160420.1)
SourcePackage: openjdk-8
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Aere Greenway (aere) wrote :
summary: - Java Desktop.browse not supported on Kubuntu 16.10
+ Java Desktop.browse not supported on Kubuntu 16.04
Revision history for this message
Tiago Stürmer Daitx (tdaitx) wrote :

Thank you for taking your time to report this bug and making Ubuntu better.

Please try to install gvfs-libs and see if that fix it, then report it back here. Do not close the bug if it does as it indicates that the openjdk-8-jre package is missing a dependency and we would need to fix that.

What follows is a more technical overview of the underlying issue.

Desktop.browse(URI) calls sun.awt.DesktopBrowse.browse(URL) which is implemented by sun.awt.X11.XDesktopPeer.desktop(URL). That in turn call the native jni method gnome_url_show(byte[] url) that is dynamically linked by jdk/src/solaris/native/sun/xawt/gnome_interface.c to the gvfs function of the same name. Thus gvfs libraries must be installed on the system for those calls to work. Still it is not clear if and how exactly this will work out on a non-gnome system: a quick search didn't indicate exactly how gnome_url_show is set up (gconf?).

Revision history for this message
Aere Greenway (aere) wrote : Re: [Bug 1574879] Re: Java Desktop.browse not supported on Kubuntu 16.04

On 04/25/2016 08:25 PM, Tiago Stürmer Daitx wrote:
> Thank you for taking your time to report this bug and making Ubuntu
> better.
>
> Please try to install gvfs-libs and see if that fix it, then report it
> back here. Do not close the bug if it does as it indicates that the
> openjdk-8-jre package is missing a dependency and we would need to fix
> that.
>
>
> What follows is a more technical overview of the underlying issue.
>
> Desktop.browse(URI) calls sun.awt.DesktopBrowse.browse(URL) which is
> implemented by sun.awt.X11.XDesktopPeer.desktop(URL). That in turn call
> the native jni method gnome_url_show(byte[] url) that is dynamically
> linked by jdk/src/solaris/native/sun/xawt/gnome_interface.c to the gvfs
> function of the same name. Thus gvfs libraries must be installed on the
> system for those calls to work. Still it is not clear if and how exactly
> this will work out on a non-gnome system: a quick search didn't indicate
> exactly how gnome_url_show is set up (gconf?).
>
On my Kubuntu 16.04 system, I installed gvfs-libs (which was not
installed before).

I then ran the application, and clicked the "Help" button on the main
application window, and got the same error message as before (no change).

Just to make sure, I rebooted, then ran the test again.

I got the same error message as before (no change).

- Aere

--
Sincerely,
Aere

Revision history for this message
Aere Greenway (aere) wrote :

On 04/25/2016 08:25 PM, Tiago Stürmer Daitx wrote:
> Still it is not clear if and how exactly
> this will work out on a non-gnome system: a quick search didn't indicate
> exactly how gnome_url_show is set up (gconf?).
I didn't see anything under /etc/gconf/ that looked like it configured
this support.

It worked using the default JRE (open java 7) on Kubuntu 15.10, and it
also works in the default JRE (open java 8) for the non-KDE desktops.

--
Sincerely,
Aere

Revision history for this message
Tiago Stürmer Daitx (tdaitx) wrote :

I made a mistake: gnome_url_show is actually in libgnome-2-0 package, not gvfs-libs. Please make sure it is installed.

Still, after taking another look it is weird that your system didn't have gvfs-libs installed. The dependency cycle is:
* OpenJDK 7 and 8 "Recommends" libgnome2-0
* libgnome2-0 "Recommends" gvfs
* gfvs depends on gfvs-libs

By default packages in "Recommends" are installed together with the other package dependencies. Given that you didn't have gvfs-libs I would to assume that libgnome2-0 didn't get installed as well.

BTW, there were no changes between OpenJDK 7 and OpenJDK 8 regarding this functionality: both depend upon gnome_url_show symbol being available in a library in the system. Thus something changed between Kubuntu 15.10 and 16.04 that is not satisfying this dependency any longer.

Revision history for this message
Aere Greenway (aere) wrote :

On 04/26/2016 08:19 AM, Tiago Stürmer Daitx wrote:
> I made a mistake: gnome_url_show is actually in libgnome-2-0 package,
> not gvfs-libs. Please make sure it is installed.
>
> Still, after taking another look it is weird that your system didn't have gvfs-libs installed. The dependency cycle is:
> * OpenJDK 7 and 8 "Recommends" libgnome2-0
> * libgnome2-0 "Recommends" gvfs
> * gfvs depends on gfvs-libs
>
> By default packages in "Recommends" are installed together with the
> other package dependencies. Given that you didn't have gvfs-libs I would
> to assume that libgnome2-0 didn't get installed as well.
>
> BTW, there were no changes between OpenJDK 7 and OpenJDK 8 regarding
> this functionality: both depend upon gnome_url_show symbol being
> available in a library in the system. Thus something changed between
> Kubuntu 15.10 and 16.04 that is not satisfying this dependency any
> longer.
>
Thank you for the additional idea to try. I will report back on that
shortly.

 From my work with the application I developed (the KeyMusician
Keyboard), and its Debian package), as of the Ubuntu 15.10 release, only
required dependencies are now installed. Before then, "Recommends"
dependencies were installed, which I wish it still did.

To overcome this change, I had to create some dummy packages that
included the "Recommends" dependencies as required dependencies of the
dummy package. I also created a dummy package that had the "Recommends"
and "Suggests" packages as required dependencies, and the user had to
install one or the other of those additional dummy packages.

I don't know why that changed in Ubuntu 15.10 - perhaps it has something
to do with the snappy package support.

--
Sincerely,
Aere

Revision history for this message
Tiago Stürmer Daitx (tdaitx) wrote : Re: [Openjdk] [Bug 1574879] Re: Java Desktop.browse not supported on Kubuntu 16.04
Download full text (5.5 KiB)

Please check your apt configuration by running:

$ apt-config dump | grep Recommends
APT::Install-Recommends "1";

"1" indicates that recommends is activated and they should be
installed by default. If recommends is disabled then double check the
apt configuration files at /etc/apt/apt.conf.d (or maybe a custom
/etc/apt/apt.conf).

On Tue, Apr 26, 2016 at 12:25 PM, Aere Greenway
<email address hidden> wrote:
> On 04/26/2016 08:19 AM, Tiago Stürmer Daitx wrote:
>> I made a mistake: gnome_url_show is actually in libgnome-2-0 package,
>> not gvfs-libs. Please make sure it is installed.
>>
>> Still, after taking another look it is weird that your system didn't have gvfs-libs installed. The dependency cycle is:
>> * OpenJDK 7 and 8 "Recommends" libgnome2-0
>> * libgnome2-0 "Recommends" gvfs
>> * gfvs depends on gfvs-libs
>>
>> By default packages in "Recommends" are installed together with the
>> other package dependencies. Given that you didn't have gvfs-libs I would
>> to assume that libgnome2-0 didn't get installed as well.
>>
>> BTW, there were no changes between OpenJDK 7 and OpenJDK 8 regarding
>> this functionality: both depend upon gnome_url_show symbol being
>> available in a library in the system. Thus something changed between
>> Kubuntu 15.10 and 16.04 that is not satisfying this dependency any
>> longer.
>>
> Thank you for the additional idea to try. I will report back on that
> shortly.
>
> From my work with the application I developed (the KeyMusician
> Keyboard), and its Debian package), as of the Ubuntu 15.10 release, only
> required dependencies are now installed. Before then, "Recommends"
> dependencies were installed, which I wish it still did.
>
> To overcome this change, I had to create some dummy packages that
> included the "Recommends" dependencies as required dependencies of the
> dummy package. I also created a dummy package that had the "Recommends"
> and "Suggests" packages as required dependencies, and the user had to
> install one or the other of those additional dummy packages.
>
> I don't know why that changed in Ubuntu 15.10 - perhaps it has something
> to do with the snappy package support.
>
> --
> Sincerely,
> Aere
>
> --
> You received this bug notification because you are a member of OpenJDK,
> which is subscribed to openjdk-8 in Ubuntu.
> https://bugs.launchpad.net/bugs/1574879
>
> Title:
> Java Desktop.browse not supported on Kubuntu 16.04
>
> Status in openjdk-8 package in Ubuntu:
> New
>
> Bug description:
> The Desktop.browse functionality of Java is not supported on the
> Kubuntu 16.04 level of the KDE desktop. It was supported in earlier
> levels.
>
> With this support no longer available, a Java application can no
> longer activate the system's browser to display the already-installed
> HTML help files for the application, making the context-sensitive help
> functionality useless.
>
> Here is the Java code snippet where the code attempts to activate the
> online help:
>
> if (Desktop.isDesktopSupported())
> {
> Desktop desktop = Desktop.getDesktop() ;
> if (desktop.isSupported(Desktop.Action.BROWSE))
> {
> ...

Read more...

Revision history for this message
Aere Greenway (aere) wrote : Re: [Bug 1574879] Re: Java Desktop.browse not supported on Kubuntu 16.04

On 04/26/2016 08:19 AM, Tiago Stürmer Daitx wrote:
> I made a mistake: gnome_url_show is actually in libgnome-2-0 package,
> not gvfs-libs. Please make sure it is installed.
>
> Still, after taking another look it is weird that your system didn't have gvfs-libs installed. The dependency cycle is:
> * OpenJDK 7 and 8 "Recommends" libgnome2-0
> * libgnome2-0 "Recommends" gvfs
> * gfvs depends on gfvs-libs
>
> By default packages in "Recommends" are installed together with the
> other package dependencies. Given that you didn't have gvfs-libs I would
> to assume that libgnome2-0 didn't get installed as well.
>
> BTW, there were no changes between OpenJDK 7 and OpenJDK 8 regarding
> this functionality: both depend upon gnome_url_show symbol being
> available in a library in the system. Thus something changed between
> Kubuntu 15.10 and 16.04 that is not satisfying this dependency any
> longer.
>
I booted the Kubuntu 16.04 test system, and checked (using Synaptic
Package Manager) the status of the libgnome-2-0 package. It showed it
to be already installed.

When I saw this problem in testing, I assumed it to be the decision of
people responsible for the KDE desktop, to not allow a Java application
to activate the system's Internet browser. So I would assume it is
something configured somewhere for the KDE desktop.

I was unsure of what package to file the bug with.

If this problem was a deliberate decision, I wanted it to be known what
side-effects that decision has on legitimate applications.

Other Ubuntu 'flavors' (not having the problem) use different desktops,
and (I presume) have different configurations.

--
Sincerely,
Aere

Revision history for this message
Aere Greenway (aere) wrote : Re: [Openjdk] [Bug 1574879] Re: Java Desktop.browse not supported on Kubuntu 16.04
Download full text (6.6 KiB)

Tiago:

I checked the apt configuration (as you requested) on two Ubuntu 16.04
systems (Ubuntu-Gnome, and Kubuntu).

It showed:

APT::Install-Recommends "true";

I also checked the apt configuration on an Ubuntu 15.10 system
(Ubuntu-MATE), and it showed:

APT::Install-Recommends "1";

All of these systems are test systems, installed from a live DVD (or
USB) desktop. There is no custom configuration of APT.

One thing to note, however, is that the installations where "Recommends"
dependencies stopped taking place as of Ubuntu 15.10 (and continuing
with Ubuntu 16.04) were done using either the Gdebi Package Installer,
or Ubuntu Software Center.

Since my application (installed as a Debian package) is not in the
repository, it has to be installed that way.

So perhaps they changed Gdebi and Ubuntu Software Center to no longer
install "Recommends" dependencies.

The newer Gnome Software installer (in Ubuntu 16.04) doesn't yet succeed
in installing external Debian packages.

- Aere

On 04/26/2016 09:44 AM, Tiago Stürmer Daitx wrote:
> Please check your apt configuration by running:
>
> $ apt-config dump | grep Recommends
> APT::Install-Recommends "1";
>
> "1" indicates that recommends is activated and they should be
> installed by default. If recommends is disabled then double check the
> apt configuration files at /etc/apt/apt.conf.d (or maybe a custom
> /etc/apt/apt.conf).
>
> On Tue, Apr 26, 2016 at 12:25 PM, Aere Greenway
> <email address hidden> wrote:
>> On 04/26/2016 08:19 AM, Tiago Stürmer Daitx wrote:
>>> I made a mistake: gnome_url_show is actually in libgnome-2-0 package,
>>> not gvfs-libs. Please make sure it is installed.
>>>
>>> Still, after taking another look it is weird that your system didn't have gvfs-libs installed. The dependency cycle is:
>>> * OpenJDK 7 and 8 "Recommends" libgnome2-0
>>> * libgnome2-0 "Recommends" gvfs
>>> * gfvs depends on gfvs-libs
>>>
>>> By default packages in "Recommends" are installed together with the
>>> other package dependencies. Given that you didn't have gvfs-libs I would
>>> to assume that libgnome2-0 didn't get installed as well.
>>>
>>> BTW, there were no changes between OpenJDK 7 and OpenJDK 8 regarding
>>> this functionality: both depend upon gnome_url_show symbol being
>>> available in a library in the system. Thus something changed between
>>> Kubuntu 15.10 and 16.04 that is not satisfying this dependency any
>>> longer.
>>>
>> Thank you for the additional idea to try. I will report back on that
>> shortly.
>>
>> From my work with the application I developed (the KeyMusician
>> Keyboard), and its Debian package), as of the Ubuntu 15.10 release, only
>> required dependencies are now installed. Before then, "Recommends"
>> dependencies were installed, which I wish it still did.
>>
>> To overcome this change, I had to create some dummy packages that
>> included the "Recommends" dependencies as required dependencies of the
>> dummy package. I also created a dummy package that had the "Recommends"
>> and "Suggests" packages as required dependencies, and the user had to
>> install one or the other of those additional dummy packages.
>>
>> I don't know why that changed in Ub...

Read more...

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in openjdk-8 (Ubuntu):
status: New → Confirmed
Changed in openjdk-8 (Ubuntu):
importance: Undecided → Low
Revision history for this message
Carl Walker (walkerca) wrote :

This causes a JavaFX app I'm working on to hang when Desktop.browse() is called. I've verified this on both 16.04 and 16.10 using the Oracle JDK (1.8.0_112).

I agree with the OP that this is important for help subsystems.

java.awt.Desktop.getDesktop().browse(URI(HELP_LINK))

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.