Splash screen problems with Java application

I am creating a snap for EduMIPS64 (www.edumips.org), a MIPS64 CPU simulator written in Java.

I got everything working, except the splash screen, which doesn’t show.

I pin-pointed the problem down to missing libsplashscreen.so in the JREs used by Snap (both JDK 8 and JDK 11): I went to mounted snap, straced the existing java and verified that it cannot find libsplashscreen.so.

The funny thing is that the standard JREs in Ubuntu work perfectly… so maybe I’m missing something?


With JDK 11 this library is at /usr/lib/jvm/java-11-openjdk-amd64/lib/libsplashscreen.so. You could try either of two options:

  1. Add the path $SNAP/usr/lib/jvm/java-11-openjdk-amd64/lib to LD_LIBRARY_PATH
  2. Use the layout feature to expose $SNAP/usr/lib/jvm/java-11-openjdk-amd64 to /usr/lib/jvm/java-11-openjdk-amd64:
        bind: $SNAP/usr/lib/jvm/java-11-openjdk-amd64

Many thanks for the suggestion, Daniel!

The problem seems to be that by default the gradle plugin uses the headless JDK (and by extension JRE).

I solved it by adding openjdk-11-jdk to the stage dependencies: https://github.com/snapcore/snapcraft/blob/master/snapcraft/plugins/v1/gradle.py#L170

I’ll open a bug and send a patch to use the standard, non-headless, JRE as a runtime dependency.

Here’s the bug: https://bugs.launchpad.net/snapcraft/+bug/1873250