Here's a snap + wrapper that seems to work.<div>It's really messy as it copies the contents of freeplane twice.</div><div><a href="https://gist.github.com/ZenHarbinger/cf3aec2d7c6110ab0a0780b315cadc2f">https://gist.github.com/ZenHarbinger/cf3aec2d7c6110ab0a0780b315cadc2f</a></div><div>--</div><div>Matt<br><br>On Thu, Dec 29, 2016 at 12:17 PM, Matthew Aguirre <matt.aguirre@gmail.com> wrote:<br>
<blockquote type="cite">I take that back, you will need the JDK to get the full on visualization libraries included.  Otherwise it defaults to headless with just the JRE.  I ran into that problem.<div><br></div><div><a href="https://github.com/ZenHarbinger/torgo">https://github.com/ZenHarbinger/torgo</a></div><div><br></div><div>While not gradle, it is a Java app with a GUI that works.</div><div>--</div><div>Matt<br><div><br>On Thu, Dec 29, 2016 at 12:06 PM, Matthew Aguirre <matt.aguirre@gmail.com> wrote:<br>
<blockquote type="cite">If you need the JDK (not just the jre), you should be able to do the following:<div><br></div><blockquote type="cite"><div>    stage-packages:</div><div>      - fontconfig-config</div><div>      - default-jdk</div><div>      - fonts-dejavu-extra</div><div>      - fonts-ipafont-gothic</div></blockquote><div><br></div><div>In your snapcraft.yaml file instead of just using including the jre.</div><div><br></div><div>If this is your complete snapcraft.yaml file, you may also need:</div><blockquote type="cite"><div>    plugs: [home, x11, opengl, network, unity7]</div></blockquote><div>or a subset of these.</div><div><br></div><div>There are some limitations with Java that I've found.</div><div><br></div><div>Here is my wrapper:</div><blockquote type="cite"><div>#!/bin/bash</div><div><br></div><div># Not good, needed for fontconfig</div><div>export XDG_DATA_HOME=$SNAP/usr/share</div><div># Font Config</div><div>export FONTCONFIG_PATH=$SNAP/etc/fonts/config.d</div><div>export FONTCONFIG_FILE=$SNAP/etc/fonts/fonts.conf</div><div>export HOME=$SNAP_USER_DATA</div><div><br></div><div>export LIBGL_DRIVERS_PATH=$SNAP/usr/lib/x86_64-linux-gnu/dri</div><div>export LIBVA_DRIVERS_PATH=$SNAP/usr/lib/x86_64-linux-gnu/dri</div><div>export LIBGL_DEBUG=verbose</div><div><br></div><div>export PATH=$PATH:/usr/local/bin</div><div><br></div><div>java -Dswing.defaultlaf=javax.swing.plaf.nimbus.NimbusLookAndFeel -Duser.home=$HOME -Dsun.java2d.opengl=true -jar $SNAP/jar/torgo-1.4.1.jar "$@"</div></blockquote><div><br></div><div>You must set the user.home directory this way for the application to work (unless this has been fixed).</div><div><br></div><div>As far as updating gradle.  Put in a LaunchPad bug and register an Issue.  While I added the gradlew plugin, I am not a gradle user, so I can definitely work on adding/fixing work.</div><div><br></div><div>If the application tries to use xdg-open or open a web-browser, there are more fixes that are needed in my experience.</div><div>--</div><div>Matt</div><div><br></div><div>On Thu, Dec 29, 2016 at 4:46 AM, Felix Natter <fnatter@gmx.net> wrote:<br>
<blockquote type="cite"><div class="plaintext" style="white-space: pre-wrap;">Dear snapcraft experts,

I am creating a simple snap for a java application:

BTW: My original post is here:
<a href="http://askubuntu.com/questions/865090/simple-java-snap-with-jre-dependency">http://askubuntu.com/questions/865090/simple-java-snap-with-jre-dependency</a>

name: freeplane-snap
version: 1.5.18-1
summary: Java program for working with Mind Maps
description: ...
confinement: devmode
grade: stable

apps:
  freeplane-snap:
    command: ./freeplane.sh

parts:
  main:
    plugin: dump
    source: freeplane-1.5.18/
    stage-packages: [openjdk-8-jre]
    filesets:
      mybuild:
        - "*"
    stage:
      - $mybuild
    snap:
      - $mybuild

Freeplane uses a gradle build system, but the snapcraft gradle plugin is
not powerful enough (expects "gradlew" to be there and not "gradle", and
is used for single jar projects, i.e. always with 'jar' option). Where
can I submit feature requests / patches for this?

So I am using the project's binary distribution (unzipped to
./freeplane-1.5.18) with the 'dump' plugin, which works well. However,
since I'm not using a java build system, the jre is missing in the snap
(when running "freeplane-snap" I get an error that the JDK cannot be
found, NOT when running freeplane.sh directly). I tried to add it with
'stage-packages: [openjdk-8-jre]' but this did not help.

Could you please tell me how to add the jre to the mix?

One more question: Hearing about this containment stuff, is it
possible/feasible (using plugs?) to to create a desktop application that
can read and write (mind maps) from/to everywhere, just like a normal
.deb? (like plugs: [network, home, tmp]?)
I also need to install the desktop file and mime type mappings to
/usr/share/... --> I assume I can do this with separate parts?

Many Thanks and Best Regards,
<div>-- 
</div>Felix Natter

<div>-- 
</div>Snapcraft mailing list
<a href="mailto:Snapcraft@lists.snapcraft.io">Snapcraft@lists.snapcraft.io</a>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/snapcraft">https://lists.ubuntu.com/mailman/listinfo/snapcraft</a>
</div></blockquote></div></blockquote></div></div></blockquote></div>