Snap not working without exterior jar

I am trying to make a snap from my fat jar (program and all its dependencies).

When I try to make it with the following yaml it only works if I have an exterior program jar file next to it.
Even though when I open the snap the jar is inside it.

Here is my yaml:

name: highlighterpdf
title: HighlighterPdf
version: 1.0.2
summary: Highiight the text in a Pdf.
description:
        HighlighterPdf  is a free and open source software application that you can use to 
        highlight text in your pdf document. You can select text in a colour of your choice        
        and then save it.
confinement: devmode


base: core18



apps:
 highlighterpdf:
   extensions: [gnome-3-28]
   command: java -jar highlighterpdf.jar
   environment:
         JAVA_HOME: $SNAP/usr/lib/jvm/java-11-openjdk-amd64
         PATH: $JAVA_HOME/bin:$PATH
   plugs:
      - home
      - network
      - cups-control
   
parts:
  highlighterpdf:
       source: https://github.com/gerry136/highlighterpdf.git
       plugin: dump

       build-packages:
           - openjdk-11-jdk
       
       stage-packages:
           - unzip
           - openjdk-11-jdk

when I try to run it without the external jar I get:
Error: Unable to access jarfile highlighterpdf.jar

where exactly is it … ?
i assume you might want:

command: java -jar $SNAP/highlighterpdf.jar

if the jar lives in /snap/highlighterpdf/current/highlighterpdf.jar

Of course that was it.

Sorry for asking such a silly question

nah, there are no silly questions …

1 Like

except “what colour tie should I wear on dress-down thursdays?” because we all know you don’t wear a tie… :-p

2 Likes