UMLet will be fixed in the next release to use xdg-open so I won’t need James’ solution in the near future.
In case someone needs to implement it, I’m documenting a minimal example of what I did to make it work here:
-
Copy everything under https://github.com/MrCarroll/runescape-snap/tree/master/osrs/java-patches to my repository
-
Add (at least) this override-build to my snapcraft.yaml
override-build: | wget https://github.com/digidigital/UMLet-snap/raw/main/java-patches/compiled/java.desktop/sun/awt/X11/XDesktopPeer.class mkdir -p ${SNAPCRAFT_PART_INSTALL}/Umlet/java-patches/compiled/java.desktop/sun/awt/X11 mv XDesktopPeer.class ${SNAPCRAFT_PART_INSTALL}/Umlet/java-patches/compiled/java.desktop/sun/awt/X11/XDesktopPeer.class
-
Create an executable launch script e.g. “launch.sh” in ${SNAPCRAFT_PART_INSTALL}/Umlet/ (Java was added to PATH)
#!/bin/bash java --patch-module java.desktop=$SNAP/Umlet/java-patches/compiled/java.desktop -Duser.home=$SNAP_USER_DATA
-
Make launch script “command” of the main part in snapcraft.yaml
apps: umlet-standalone: command: Umlet/launch.sh
If you pull the whole repository with “dump” your snapcraft.yaml will look a bit different (e. g. no wget). My snapcraft.yaml just downloads a zip-file with a jar-file and the Java module…