Skip to content
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

GitHub Actions build for linux - can install but not run #51

Open
abulka opened this issue Dec 17, 2021 · 3 comments
Open

GitHub Actions build for linux - can install but not run #51

abulka opened this issue Dec 17, 2021 · 3 comments

Comments

@abulka
Copy link

abulka commented Dec 17, 2021

I tried installing the .deb built by the linux build action on my Ubuntu 18.04. Double clicking on the file
https://github.com/wiverson/maven-jpackage-template/releases/download/Ubuntu-latest/testapp_21.40.052006-1_amd64.deb
installs it ok, but finding it via the Desktop search and then running it did nothing. So I ran it from the terminal:

$ dpkg -L testapp | grep bin
/opt/testapp/bin
/opt/testapp/bin/TestApp

andy@ubuntu-amd:~$ /opt/testapp/bin/TestApp

(TestApp:8329): Gdk-WARNING **: 10:55:57.048: XSetErrorHandler() called with a GDK error trap pushed. Don't do that.

Update:

I uninstalled it and installed it again using the command line - only to see a broken repository error being reported?

$ sudo apt install /home/andy/Downloads/testapp_21.40.052006-1_amd64.deb
Reading package lists... Done
...
Setting up testapp (21.40.052006-1) ...
W: Repository is broken: testapp:amd64 (= 21.40.052006-1) has no Size information

Despite the error, the TestApp seems to be installed ok, but with the same GDK error trap error when attempting to run it.

@wiverson
Copy link
Owner

FWIW I don't know much of anything about how deb packaging works. I'm just picking up the package emitted by package. 🤷‍♂️

Glancing at the docs https://docs.oracle.com/en/java/javase/14/docs/specs/man/jpackage.html there are a bunch of flags specific to Linux that I'm not familiar with but look a lot like some of the same unique identifier stuff required by other OSes. Maybe setting some of those flags...?

@abulka
Copy link
Author

abulka commented Dec 17, 2021

Yeah I don't know much about deb packaging either 🤗. I did some googling and it might be related to GTK versions. In my testing, this launch bug happens in both 18.04 and 21.10 - both of which seem to come with both gtk2 and gtk3. Check with dpkg -l libgtk2.0-0 libgtk-3-0. This post suggests this bug should have gone away viz. "In JDK 10 and earlier, GTK 2 was the default. But from FX 11, GTK3 is now the default."

Trying flag -Djdk.gtk.version=2

This post suggests -Djdk.gtk.version=2 so I took a guess and added

--java-options '-Djdk.gtk.version=2'

to the file src/packaging/linux-jpackage.txt.

When I installed and ran the TestApp .deb, this time I got the error Gtk-Message: 17:28:41.018: Failed to load module "canberra-gtk-module". Same error message under both Ubuntu 18.04 and 21.10.

Trying flag -Djdk.gtk.version=3

This post suggests the flags java -Djdk.gtk.verbose=true -Djdk.gtk.version=3. So I changed src/packaging/linux-jpackage.txt to contain

--java-options '-Djdk.gtk.verbose=true'
--java-options '-Djdk.gtk.version=3'

Under both Ubuntu 18.04 and 21.10 I got:

$ /opt/testapp/bin/TestApp
checking GTK version 3
trying GTK library libgtk-3.so.0
using GTK library version 3 set libgtk-3.so.0
Glass GTK library to load is glassgtk3
loaded gdk_x11_display_set_window_scale
loaded g_settings_schema_source_get_default
loaded g_settings_schema_source_lookup
loaded g_settings_schema_has_key
found schema 'org.gnome.desktop.interface' and key 'scaling-factor'
loaded g_settings_schema_unref

(TestApp:10084): Gdk-WARNING **: 17:42:32.645: XSetErrorHandler() called with a GDK error trap pushed. Don't do that.

@wiverson
Copy link
Owner

That is absolute exemplar Linux yak shaving... >_<

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants