Problems creating a Snap for a Java Application

thats typically “Swing” and you should be able to theme it using GTK2 themes …

There is mention of Swing in the error report. The guy who wrote the Java application hasn’t responded to an update on it from me a month ago, so I will have to assume he has lost interest. Thanks for your patience on this ogra, I have learnt a lot! I will switch my effort to my own Python application.

Hi,
I’m trying to create a snap for java swing application, after created a snap swing application launches but shows the following errors

    (java:20004): GdkPixbuf-WARNING **: 11:19:49.078: Cannot open pixbuf loader module file '/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache': No such file or directory

This likely means that your installation is broken.
Try running the command
  gdk-pixbuf-query-loaders > /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache
to make things work again for the time being.


ALSA lib conf.c:3916:(snd_config_update_r) Cannot access file /usr/share/alsa/alsa.conf
ALSA lib control.c:1373:(snd_ctl_open_noupdate) Invalid CTL hw:0
Core/ErrorSuppressed Error: -1 : Failed to open sound control interface

java.io.IOException: Cannot run program "/usr/bin/xprop": error=2, No such file or directory

my snapcraft.yaml file

name: facecheck # you probably want to 'snapcraft register <name>'
base: core18 # the base snap is the execution environment for this snap
version: '1.0' # just for humans, typically '1.2+git' or '1.3.2'
summary: Face recognition # 79 char long summary
description: |
  This application is used to recognise and detect the persons face
  with the enrolled data from database.

grade: devel # must be 'stable' to release into candidate/stable channels
confinement: devmode # use 'strict' once you have the right plugs and slots

apps:
  facecheck:
    command: usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java -jar $SNAP/Bin/Java/simple-surveillance-application.jar
    environment:
      JAVA_HOME: $SNAP/usr/lib/jvm/java-1.8.0-openjdk-amd64
      PATH: $JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH
      LD_LIBRARY_PATH: $SNAP/Lib/Linux_x86_64
    plugs: [desktop, home, camera, x11, desktop-legacy, opengl, alsa, pulseaudio]
    autostart: Facecheck-surveillance.desktop

parts:
  facecheck:
    # See 'snapcraft plugins'
    source: .
    plugin: dump
    build-packages: 
    - nvidia-384-dev
    - libgtk-3-dev
    - gstreamer1.0-vaapi
    - vainfo
    - openjdk-8-jre
    - openjdk-8-demo
    - libgdk-pixbuf2.0-dev
    - alsa-utils
    - libasound2-data
    - libasound2-plugins
    - libasound2
    - libopus-dev
    - libortp-dev
    - gcc
    - g++
    - make
    - libgudev-1.0-0
    - libgudev-1.0-dev 
    - libgstreamer1.0-0 
    - gstreamer1.0-plugins-base 
    - gstreamer1.0-plugins-good 
    - gstreamer1.0-plugins-bad 
    - gstreamer1.0-plugins-ugly 
    - gstreamer1.0-libav 
    - gstreamer1.0-doc 
    - gstreamer1.0-tools 
    - gstreamer1.0-x 
    - gstreamer1.0-alsa 
    - gstreamer1.0-gl 
    - gstreamer1.0-gtk3 
    - gstreamer1.0-qt5 
    - gstreamer1.0-pulseaudio
    - libfontconfig1-dev 
    - libfreetype6-dev 
    - libpng-dev
    - libcairo2-dev 
    - libjpeg-dev 
    - libgif-dev
    - libgstreamer-plugins-base1.0-dev
    - python-gst-1.0 
    - python3-gst-1.0
    - postgresql
    - postgresql-contrib
    - odbc-postgresql
    - unixodbc
    - unixodbc-dev
    - build-essential
    - manpages-dev
    stage-packages:
    - libgpm2
    - libslang2 
    - libnvidia-compute-390
    - openjdk-8-jre
    - openjdk-8-demo
    - nvidia-384-dev
    - libgtk-3-dev
    - gstreamer1.0-vaapi
    - vainfo
    - libgdk-pixbuf2.0-dev
    - alsa-utils
    - libasound2-data
    - libasound2
    - libasound2-plugins
    - gcc
    - g++
    - make
    - libgudev-1.0-0
    - libgudev-1.0-dev
    - libgstreamer1.0-0 
    - gstreamer1.0-plugins-base 
    - gstreamer1.0-plugins-good 
    - gstreamer1.0-plugins-bad 
    - gstreamer1.0-plugins-ugly 
    - gstreamer1.0-libav 
    - gstreamer1.0-doc 
    - gstreamer1.0-tools 
    - gstreamer1.0-x 
    - gstreamer1.0-alsa 
    - gstreamer1.0-gl 
    - gstreamer1.0-gtk3 
    - gstreamer1.0-qt5 
    - gstreamer1.0-pulseaudio
    - libfontconfig1-dev 
    - libfreetype6-dev 
    - libpng-dev
    - libcairo2-dev 
    - libjpeg-dev 
    - libgif-dev
    - libgstreamer-plugins-base1.0-dev
    - python-gst-1.0 
    - python3-gst-1.0
    - postgresql
    - postgresql-contrib
    - odbc-postgresql
    - unixodbc
    - unixodbc-dev
    - build-essential
    - manpages-dev

I think the dependencies are not installed properly. Is my yaml file creation procedure is correct?
What may be reason for getting the above mentioned errors?