-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Java application fails to launch browser ("The BROWSE action is not supported on the current platform!") #1
Comments
I'm the maintainer of a proprietary Java program on Flathub that tries to do the same thing. Unfortunately, because I'm unable to patch that program, the next best solution I found is to use the GNOME runtime instead of the Freedesktop one, plus a new set of dbus permissions. Something like this: runtime: org.gnome.Platform
runtime-version: '42'
sdk: org.gnome.Sdk
sdk-extensions:
- org.freedesktop.Sdk.Extension.openjdk17 And add these permissions: finish-args:
- --share=ipc
- --talk-name=org.gtk.vfs.*
- --filesystem=xdg-run/gvfsd You can take a look here for the complete manifest file. Alternatively, you can try to patch Audiveris like this, which will then work on Flatpak without having to switch runtimes. |
Thanks! Being a Java noob - if you could patch the program, what would you do? |
I'd maybe add some check after line 96: if (Desktop.isDesktopSupported() && desktop.isSupported(Desktop.Action.BROWSE)) {
// Default behavior
desktop.browse(uri);
} else {
// Detect Linux and fallback to xdg-open
if (System.getProperty("os.name").toLowerCase().contains("nux")) {
Process p = Runtime.getRuntime().exec(new String[] { "xdg-open", uri });
p.waitFor();
p.destroy();
}
} Very rough implementation and I haven't really tested it though |
Thanks a lot!! And apologies, I'd overlooked that you'd actually answered my last question in your first reply already. Anyway, I believe that this should eventually be fixed either in openJDK itself or in flatpak's openJDK package. |
I've come up with a slightly different approach now. |
I am trying to build a flatpak package for Audiveris. The application fails to open a web browser to show the documentation:
When this happens, no activity is seen on the DBus session bus, so the Java app doesn't seem to try to address the XDG portal via DBus. This seems to be a known problem (1, 2). I've verified that it doesn't occur if I run the application natively. However there are also some Java applications that seem to be able to open a browser in flatpak. I lack both Java and flatpak experience to judge what exactly is going wrong. Anyway, there seems to be a solution for openJDK11 in 2 that hasn't been merged for more than a year.
The latest version of Audiveris (5.2.5) utilizes openJDK 17, whereas 5.2.4 uses openJDK11. I'm observing the issue in both environments, using
org.freedesktop.Sdk.Extension.openjdk11/21.08
andorg.freedesktop.Sdk.Extension.openjdk17/21.08
, respectively.What should I do to make this work?
Footnotes
https://github.com/flathub/org.freedesktop.Sdk.Extension.openjdk11/issues/15 ↩
https://github.com/flathub/org.freedesktop.Sdk.Extension.openjdk11/pull/16 ↩ ↩2
The text was updated successfully, but these errors were encountered: