Flatpak of Java 8 application

I packaged an application which has the requirement of running with Java 8. I have 2 issues:

  • if I package the application with the runtime org.freedesktop.Platform 24.08 or down to 19.08, opening a file browser from within the application takes ages (until it gives a timeout). The only way I found was to use the runtime 18.08 and then the file browser appears directly. When I try to open a file browser, I get from the logs "Could not query portal version on interface ‘org.freedesktop.portal.FileChooser’ Error calling StartByServiceByName for org.freedesktop.portal.Desktop: Timeout was reached. And additionally: “GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER is not supported by GtkChooseNativePortal because portal is too old”.

  • within the application, it’s possible to open a PDF with the default PDF application but this doesn’t work with the flatpak. I have checked from the system and the following command works:

xdg-mime query default application/pdf
org.gnome.Evince.desktop

At the moment, the flatpak application has all possible permissions so I believe that’s not the problem, I suspect that the Java 8 doesn’t speak properly with the portal I have.

I am running the application on a RHEL 9 system with all xdg-portal packages installed.

Any ideas, hints would be welcome!

Shouldn’t this be using xdg-open?

Well I am not really sure. But if I run a xdg-open test.pdf on the host system it works, but inside a shell in the flatpak it just doesn’t do anything.

Actually I think the problem comes from RHEL9 or the way I have the operating system configured. I have tried with another flatpak org.kde.dolphin and I get the same behavior. I will try from another OS like Ubuntu to see if I get this working.