3

I'm trying to create a snap for a JavaFX application, but I can't seem to figure out how to structure the yaml file.

I've read that I need to use the desktop-launch command, but I also need to call Java's java -jar command. I'm not sure how to put these two things together.

Anyway, here's my current snapcraft.yaml file.

name: apuviewer # you probably want to 'snapcraft register <name>'
version: '1.0' # just for humans, typically '1.2+git' or '1.3.2'
summary: Single-line elevator pitch for your amazing snap # 79 char long summary
description: |
  Description

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

apps:
  apuviewer:
    command: desktop-launch $SNAP/apuViewer-1.0.jar
    plugs: [home, network, x11]

parts:
  apuviewer:
    source: .
    plugin: dump
    after: [desktop-gtk3]
    build-packages:
    - ca-certificates
    - ca-certificates-java
    - openjdk-8-jre-headless
    stage-packages:
    - openjdk-8-jre-headless

It's currently throwing this error: /snap/apuviewer/x1/bin/desktop-launch: line 545: exec: /snap/apuviewer/x1/apuViewer-1.0.jar: cannot execute: Permission denied

I've tried many different things, but can't seem to get it to run. Any help is much appreciated!

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.