Isso funciona perfeitamente.
grade: stable
confinement: strict
apps:
test:
command: usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java -jar $SNAP/src/SnapTest.jar
plugs: [unity7, network, home]
environment:
JAVA_HOME: $SNAP/usr/lib/jvm/default-java
CLASSPATH: $SNAP/jar/SnapTest.jar
PATH: $SNAP/usr/lib/jvm/default-java/bin:$PATH
parts:
test:
source: .
plugin: dump
stage-packages: [openjdk-8-jre, openjdk-8-demo]