Problems creating a Snap for a Java Application


#1

Error: Task ‘release’ not found in root project ‘build’.

I followed the instructions here to create a Snap from a Java application. I copied the .yaml file, changed the name of the application and removed ‘-x test -x createGitTag’ as they caused a failure and didn’t seem necessary. It failed with the error above.

name: myapp
version: '1.6.10' 
summary: Application for Mind Mapping, Knowledge and Project Management
description: |
  myapp is a free and open source software application that supports
  thinking, sharing information and getting things done at work, in school
  and at home. The core of the software is tools for mind mapping (also
  known as concept mapping or information mapping) and using mapped
  information.

confinement: devmode

apps:
  myapp:
    command: desktop-launch $SNAP/myapp-1.6.10/myapp.sh

parts:
  myapp:
    after: [desktop-glib-only]
    plugin: gradle
    source: .
    build: |
      export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64"
      #gradle release -x test -x createGitTag
      gradle release

    install: |
      unzip DIST/myapp_bin-*.zip -d $SNAPCRAFT_PART_INSTALL/
    build-packages:
      - unzip
      - openjdk-8-jdk

#2

So I copied another sample .yaml for a Java application:

name: myapp
version: '0.0.0' 
summary: Test Application
description: |
  myapp is a free and open source software application.

confinement: devmode

apps:
  myapp:
    #command: desktop-launch $SNAP/myapp-0.0.0/myapp.sh
    command: myapp.sh

    plugs: [home]                  #ADDED FOR FILE ACCESS

parts:
  myapp:
    source: .
    plugin: dump
    #organize:
    #  FileChooserDemo.sh: bin/FileChooserDemo.sh #removed, no idea what this does
    stage-packages: [openjdk-8-jre, openjdk-8-demo]

That works and I can install it, but I can’t run it.

root@desktop:/home/chris/SnapWorks# snap install --devmode myapp/myapp_0.0.0_amd64.snap
myapp 0.0.0 installed

root@desktop:/home/chris/SnapWorks# myapp
Command 'myapp' is available in '/snap/bin/myapp'
The command could not be located because '/snap/bin' is not included in the PATH environment variable.
myapp: command not found

root@desktop:/home/chris/SnapWorks# /snap/bin/myapp
/snap/myapp/x1/myapp.sh: 1: /snap/myapp/x1/myapp.sh: java: not found
root@desktop:/home/chris/SnapWorks#

root@desktop:/home/chris/SnapWorks# cd /snap/myapp/x1

root@desktop:/snap/myapp/x1# /snap/myapp/x1/myapp.sh
Error: Could not find or load main class org.myapp.myappStarter
Caused by: java.lang.ClassNotFoundException: org.myapp.myappStarter
root@desktop:/snap/myapp/x1# 

There seem to be several directory problems, I’m confused!


#3

never run snapcraft as root, it might trash your system if there is something wrong in your install targets in the snapcraft parts (because you made a typo or whatnot in snapcraft.yaml) and install random stuff to the rootfs of your build host. if a snapcraft build needs root access to fulfill one of the tasks (typically only installing the build-packages once the first time you build) it has builtin sudo support and will ask for a password.

this is handled by a POSIX compliant profile snippet in /etc/profile.d, if you freshly installed snapd and did not re-login it will not be in your PATH … if you use some non-POSIX compliant shell like zsh or fish, you will have to use the shells mechanism to add it manually.

try changing your apps entry in snapcraft.yaml to set the proper JAVA_HOME:

apps:
  myapp:
    environment:
      JAVA_HOME: $SNAP/usr/lib/jvm/java-1.8.0-openjdk-amd64
      PATH: $JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH
    command: myapp.sh
    plugs: [home]

alternatively you could just add it to the top of your “myapp” shell script …


#4

never run snapcraft as root
I was wondering about that! Thanks for reading my post carefully and giving a well-considered answer, I’ll have a closer look at this tomorrow. Should I include the whole of your file in myapp.sh or just this?

if [ “$SNAP_ARCH” = “amd64” ]; then
ARCH=“x86_64-linux-gnu”
elif [ “$SNAP_ARCH” = “armhf” ]; then
ARCH=“arm-linux-gnueabihf”
else
ARCH="$SNAP_ARCH-linux-gnu"
fi


#5

you mainly want JAVA_HOME and PATH exported. if you dont build for more than one target arch you can indeed hardcode the architecture in the export line of JAVA_HOME instead of using SNAP_ARCH.

if your app uses X11 you might also want to have the font bits (and add the necessary bits to stage-packages to have fontconfig and at least one font in the snap)


#6

It runs!!! There are a couple of problems though.

$SNAP is empty
‘/snap/bin’ was already included in the PATH but the shared library file causes an error
chris@desktop:~/Snaps$ /snap/bin/myapp
/snap/myapp/x1/myapp.sh: 4: /snap/myapp/x1/myapp.sh: java: not found

The couple of things you suggested didn’t work, but it gave me some ideas, this doesn’t work
command: /snap/myapp/current/myapp.sh

but with cd /snap/myapp/x1/myapp in myapp.sh and if I just type /snap/myapp/current/myapp.sh it works

Despite these niggles, it seems a much simpler process than creating a deb.


#7

check if your path in the wrapper is correct:

find /snap/myapp/current/ -name '*java*'

to enter the snap environment try:

snap run --shell myapp

then you can check the environment with env, look around in the environment for writable dirs and test what your app can access.

… because it does not run as a snap then and uses JAVA_HOME from your current shell session (read: it runs on the host as if you just had unpacked it to /opt, not in the snap env under confinement)


#8

because it does not run as a snap then and uses JAVA_HOME from your current shell session (read: it runs on the host as if you just had unpacked it to /opt, not in the snap env under confinement)

Haha! I suspected that! It all seemed too easy.

check if your path in the wrapper is correct: find /snap/myapp/current/ -name ‘java

chris@desktop:~$ find /snap/myapp/current/ -name '*java*'
/snap/myapp/current/etc/java-8-openjdk
/snap/myapp/current/etc/java-8-openjdk/security/java.policy
/snap/myapp/current/etc/java-8-openjdk/security/java.security
/snap/myapp/current/etc/ssl/certs/java
find: ‘/snap/myapp/current/etc/ssl/private’: Permission denied
/snap/myapp/current/lib/java-http-proxy.jar
etc....

> snap run --shell myapp
env produces (edited)
chris@desktop:/home/chris$ env
SNAP_USER_COMMON=/home/chris/snap/myapp/common
USER=chris
SNAP_LIBRARY_PATH=/var/lib/snapd/lib/gl:/var/lib/snapd/lib/gl32:/var/lib/snapd/void
SNAP_COMMON=/var/snap/myapp/common
SNAP_INSTANCE_NAME=myapp
SNAP_USER_DATA=/home/chris/snap/myapp/x1
SNAP_DATA=/var/snap/myapp/x1
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
HOME=/home/chris/snap/myapp/x1
SNAP_NAME=myapp
SNAP=/snap/myapp/x1
...
chris@desktop:/home/chris$

Which looks OK to me, so I don’t understand what is wrong.

This is what I have run:
#to install utilities
sudo apt install snapcraft build-essential
sudo snap install lxd
sudo lxd init # accept all the default settings
sudo adduser chris lxd
#logout and login again

#to create snap
sudo cd /home/chris/myapp
sudo snapcraft clean myapp
sudo snapcraft cleanbuild
sudo snap install --devmode myapp_0.0.0_amd64.snap

#to run
myapp

I also have a Python app which I have Snapped and which starts OK (it errors with "No module named ‘PIL’ ", but that’s for another day :). So what is the difference?

App under discussion

version: '3.46.1' 
summary: An electronic circuit layout designer for stripboards.
description: |
  Electronic circuit layout designer for stripboards.
  DIY Layout Creator (myapp for short) is a drawing tool developed with help of a
  large online community of DIY electronics enthusiasts. It incorporates many
  ideas that came from people using older versions of the application.  The goal
  is to provide a simple interface and enough power to let the user draw
  schematics, board/chassis layouts and wiring diagrams quickly and
  without a steep learning curve.

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

icon: splash.png      #added by me
apps:
  myapp:
#    environment:                                                #added after poster
#      JAVA_HOME: $SNAP/usr/lib/jvm/java-1.8.0-openjdk-amd64     #added after poster
#      PATH: $JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH             #added after poster
    #command: desktop-launch $SNAP/myapp-3.46.1/myapp.sh
    #command: $SNAP/myapp-3.46.1/myapp.sh
    command: bin/myapp/myapp.sh
    plugs: [home]                  #ADDED FOR FILE ACCESS

parts:
  myapp:
    source: .
    plugin: dump
    #organize:
    #  FileChooserDemo.sh: bin/FileChooserDemo.sh #removed, no idea what this does
    stage-packages: [openjdk-8-jre, openjdk-8-demo]

Python app

name: pythonapp      # you probably want to 'snapcraft register <name>'
version: '1.5.0'
summary: Creates 3D images from photographs taken with an ordinary camera.
description: |
  Take a set of photos of a subject and the software will create a 3D image
  from each pair of photos in the set, so that you can choose the best.
  Vertical and rotational alignment of the left and right images is essential for a
  convincing 3D effect, but difficult to achieve with an ordinary camera. The software 
  corrects any misalignment.
  Formats available are anaglyph (red/cyan), side-by-side and crossover.
  Several sets of photos can be processed at once, they can be previewed and poor ones can
  be deleted.

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

icon: pythonapp_logo.png

apps:
  pythonapp:
    command: pythonapp.py

parts:
  pythonapp:
    source: . # the directory in which snapcraft was executed.
    plugin: dump
    build-packages:
    - hugin
    - python3
    - python3-pil
    - libgtk-3-0
    - gir1.2-gtk-3.0    #not sure
    - python3-gi
    - libpython3-all-dev #maybe this is the answer

One has plugs: [home] which I think allows access to the home directory and stage package statements, the other build package statements.


#9

hmm, you did cut off the interesting part from that output … i wanted to see if there is a bin/java somewhere in the output and if the paths match what you put as JAVA_HOME into your snapcraft.yaml …

in general, if you post a snapcraft.yaml in this forum, please put three backticks before and after the paste so it is treated as code and the indendation does not get lost, the above is close to unreadable …

you seem to have commented “environment:, JAVA_HOME: and PATH:” in your snapcraft.yaml, what happens if you uncomment that …

note that plugs do not matter as long as you have “confinement: devmode” in your snapcraft.yaml


#10

hmm, you did cut off the interesting part from that output … i wanted to see if there is a bin/java somewhere in the output and if the paths match what you put as JAVA_HOME into your snapcraft.yaml …

It’s an long list and I wasn’t sure what to show. Neither of the above exist:
chris@desktop:/home/chris/Snaps$ env
TILIX_ID=604c315d-6e82-46ca-8fe1-1738b68cb49d
XDG_VTNR=7
SSH_AGENT_PID=3166
XDG_SESSION_ID=c2
DBUS_STARTER_ADDRESS=unix:path=/run/user/1000/bus,guid=5c35b4dbb0f90b9da19cf8d25c2f4a12
XDG_GREETER_DATA_DIR=/var/lib/lightdm-data/chris
QT_STYLE_OVERRIDE=
GPG_AGENT_INFO=/run/user/1000/gnupg/S.gpg-agent:0:1
VTE_VERSION=5401
XDG_MENU_PREFIX=gnome-
SNAP_USER_COMMON=/home/chris/snap/myapp/common
TERM=xterm-256color
SHELL=/bin/bash
SNAP_CONTEXT=bq9yV5FHMl28w0nrDqgg0fNXbwGr2Kx866Q8DQn6y6rN
TMPDIR=/tmp
GTK_MODULES=gail:atk-bridge
SNAP_REEXEC=
USER=chris
QT_ACCESSIBILITY=1
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:.tar=01;31:.tgz=01;31:.arc=01;31:.arj=01;31:.taz=01;31:.lha=01;31:.lz4=01;31:.lzh=01;31:.lzma=01;31:.tlz=01;31:.txz=01;31:.tzo=01;31:.t7z=01;31:.zip=01;31:.z=01;31:.Z=01;31:.dz=01;31:.gz=01;31:.lrz=01;31:.lz=01;31:.lzo=01;31:.xz=01;31:.zst=01;31:.tzst=01;31:.bz2=01;31:.bz=01;31:.tbz=01;31:.tbz2=01;31:.tz=01;31:.deb=01;31:.rpm=01;31:.jar=01;31:.war=01;31:.ear=01;31:.sar=01;31:.rar=01;31:.alz=01;31:.ace=01;31:.zoo=01;31:.cpio=01;31:.7z=01;31:.rz=01;31:.cab=01;31:.wim=01;31:.swm=01;31:.dwm=01;31:.esd=01;31:.jpg=01;35:.jpeg=01;35:.mjpg=01;35:.mjpeg=01;35:.gif=01;35:.bmp=01;35:.pbm=01;35:.pgm=01;35:.ppm=01;35:.tga=01;35:.xbm=01;35:.xpm=01;35:.tif=01;35:.tiff=01;35:.png=01;35:.svg=01;35:.svgz=01;35:.mng=01;35:.pcx=01;35:.mov=01;35:.mpg=01;35:.mpeg=01;35:.m2v=01;35:.mkv=01;35:.webm=01;35:.ogm=01;35:.mp4=01;35:.m4v=01;35:.mp4v=01;35:.vob=01;35:.qt=01;35:.nuv=01;35:.wmv=01;35:.asf=01;35:.rm=01;35:.rmvb=01;35:.flc=01;35:.avi=01;35:.fli=01;35:.flv=01;35:.gl=01;35:.dl=01;35:.xcf=01;35:.xwd=01;35:.yuv=01;35:.cgm=01;35:.emf=01;35:.ogv=01;35:.ogx=01;35:.aac=00;36:.au=00;36:.flac=00;36:.m4a=00;36:.mid=00;36:.midi=00;36:.mka=00;36:.mp3=00;36:.mpc=00;36:.ogg=00;36:.ra=00;36:.wav=00;36:.oga=00;36:.opus=00;36:.spx=00;36:.xspf=00;36:
INVOCATION_ID=985711bab62347d0b03c1c97b0f6949b
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
SNAP_LIBRARY_PATH=/var/lib/snapd/lib/gl:/var/lib/snapd/lib/gl32:/var/lib/snapd/void
SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
SNAP_COMMON=/var/snap/myapp/common
SESSION_MANAGER=local/desktop:@/tmp/.ICE-unix/2980,unix/desktop:/tmp/.ICE-unix/2980
SNAP_INSTANCE_NAME=myapp
SNAP_USER_DATA=/home/chris/snap/myapp/x1
SNAP_DATA=/var/snap/myapp/x1
XDG_CONFIG_DIRS=/etc/xdg/xdg-budgie-desktop:/etc/xdg
DESKTOP_SESSION=budgie-desktop
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
TEMPDIR=/tmp
QT_IM_MODULE=ibus
QT_QPA_PLATFORMTHEME=gtk2
XDG_SESSION_TYPE=x11
PWD=/home/chris/Snaps
XMODIFIERS=@im=ibus
LANG=en_GB.UTF-8
GDM_LANG=en_GB
IM_CONFIG_PHASE=1
GDMSESSION=budgie-desktop
SNAP_REVISION=x1
DBUS_STARTER_BUS_TYPE=session
XDG_SEAT=seat0
HOME=/home/chris/snap/myapp/x1
SHLVL=2
LANGUAGE=en_GB:en
SNAP_NAME=myapp
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
SNAP_COOKIE=bq9yV5FHMl28w0nrDqgg0fNXbwGr2Kx866Q8DQn6y6rN
LOGNAME=chris
XDG_SESSION_DESKTOP=budgie-desktop
XDG_DATA_DIRS=/usr/share/budgie-desktop:/usr/local/share:/usr/share:/var/lib/snapd/desktop
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus,guid=5c35b4dbb0f90b9da19cf8d25c2f4a12
LESSOPEN=| /usr/bin/lesspipe %s
SNAP_ARCH=amd64
JOURNAL_STREAM=9:35311
MANAGERPID=2930
SNAP_VERSION=3.46.1
DISPLAY=:0
XDG_RUNTIME_DIR=/run/user/1000/snap.myapp
XDG_CURRENT_DESKTOP=Budgie:GNOME
SNAP=/snap/myapp/x1
LESSCLOSE=/usr/bin/lesspipe %s %s
SNAP_INSTANCE_KEY=
XAUTHORITY=/home/chris/.Xauthority
COLORTERM=truecolor
_=/usr/bin/env
chris@desktop:/home/chris/Snaps$

in general, if you post a snapcraft.yaml in this forum, please put three backticks before and after the paste so it is treated as code and the indendation does not get lost, the above is close to unreadable …

Sorry about the format, most forums have a button for “code”, but this one hasn’t. I’ve added them.

you seem to have commented “environment:, JAVA_HOME: and PATH:” in your snapcraft.yaml, what happens if you uncomment that …

I think I commented above that it doesn’t work, and after checking I find that it still doesn’t

note that plugs do not matter as long as you have “confinement: devmode” in your snapcraft.yaml

I’ve removed “plugs” as I probably don’t need it anyway.


The content of myapp.sh

cd /snap/myapp/x1
java -splash:splash.png -Xms512m -Xmx2048m -Dorg.myapp.scriptRun=true -Dfile.encoding=UTF-8 -cp myapp.jar:lib org.myapp.myappStarter

#11

… i meant the “find” command …

you will, eventually, else your app wont have any access to any system resources once you switch it to strict …

instead of cd’ing i’d try to use $SNAP and $SNAP_USER_DATA in the command to point to the correct dirs … (but thats further down the road, like the plugs above, you first need to get JAVA_HOME and the PATH right to point to the correct dirs).


#12

… i meant the “find” command …

chris@desktop:~$ find /snap/myapp/current/ -name '*java*'
/snap/myapp/current/etc/java-8-openjdk
/snap/myapp/current/etc/java-8-openjdk/security/java.policy
/snap/myapp/current/etc/java-8-openjdk/security/java.security
/snap/myapp/current/etc/ssl/certs/java
find: ‘/snap/myapp/current/etc/ssl/private’: Permission denied
/snap/myapp/current/lib/java-http-proxy.jar
/snap/myapp/current/usr/lib/debug/usr/lib/jvm/java-1.8.0-openjdk-amd64
/snap/myapp/current/usr/lib/jvm/.java-1.8.0-openjdk-amd64.jinfo
/snap/myapp/current/usr/lib/jvm/java-1.8.0-openjdk-amd64
/snap/myapp/current/usr/lib/jvm/java-8-openjdk-amd64
/snap/myapp/current/usr/lib/jvm/java-8-openjdk-amd64/bin/java
/snap/myapp/current/usr/lib/jvm/java-8-openjdk-amd64/bin/java-rmi.cgi
/snap/myapp/current/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
/snap/myapp/current/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libjava.so
/snap/myapp/current/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libjava_crw_demo.so
/snap/myapp/current/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libjavajpeg.so
/snap/myapp/current/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libjavalcms.so
/snap/myapp/current/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/java.policy
/snap/myapp/current/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/java.security
/snap/myapp/current/usr/lib/jvm/java-8-openjdk-amd64/jre/man/ja_JP.UTF-8/man1/java.1.gz
/snap/myapp/current/usr/lib/jvm/java-8-openjdk-amd64/jre/man/man1/java.1.gz
/snap/myapp/current/usr/lib/jvm/java-8-openjdk-amd64/man/ja_JP.UTF-8/man1/java.1.gz
/snap/myapp/current/usr/lib/jvm/java-8-openjdk-amd64/man/man1/java.1.gz
/snap/myapp/current/usr/sbin/update-java-alternatives
/snap/myapp/current/usr/share/applications/openjdk-8-java.desktop
/snap/myapp/current/usr/share/bash-completion/completions/update-java-alternatives
/snap/myapp/current/usr/share/ca-certificates-java
/snap/myapp/current/usr/share/ca-certificates-java/ca-certificates-java.jar
/snap/myapp/current/usr/share/doc/ca-certificates-java
/snap/myapp/current/usr/share/doc/java-common
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/demo/applets/ArcTest/ArcTest.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/demo/applets/BarChart/BarChart.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/demo/applets/Blink/Blink.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/demo/applets/CardTest/CardTest.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/demo/applets/Clock/Clock.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/demo/applets/DitherTest/DitherTest.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/demo/applets/DrawTest/DrawTest.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/demo/applets/Fractal/CLSFractal.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/demo/applets/GraphicsTest/AppletFrame.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/demo/applets/GraphicsTest/GraphicsTest.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/demo/applets/MoleculeViewer/Matrix3D.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/demo/applets/MoleculeViewer/XYZApp.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/demo/applets/NervousText/NervousText.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/demo/applets/SimpleGraph/GraphApplet.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/demo/applets/SortDemo/BidirBubbleSortAlgorithm.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/demo/applets/SortDemo/BubbleSortAlgorithm.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/demo/applets/SortDemo/QSortAlgorithm.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/demo/applets/SortDemo/SortAlgorithm.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/demo/applets/SortDemo/SortItem.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/demo/applets/SpreadSheet/SpreadSheet.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/demo/applets/WireFrame/Matrix3D.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/demo/applets/WireFrame/ThreeD.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/demo/nio/zipfs/Demo.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/annotations/DependencyChecker/PluginChecker/src/checker/Device.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/annotations/DependencyChecker/PluginChecker/src/checker/Module.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/annotations/DependencyChecker/PluginChecker/src/checker/PluginChecker.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/annotations/DependencyChecker/PluginChecker/src/checker/Require.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/annotations/DependencyChecker/PluginChecker/src/checker/RequireContainer.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/annotations/DependencyChecker/Plugins/src/plugins/BoilerPlugin.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/annotations/DependencyChecker/Plugins/src/plugins/ExtendedBoilerPlugin.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/annotations/DependencyChecker/Plugins/src/plugins/TimerPlugin.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/annotations/Validator/src/PositiveIntegerSupplier.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/annotations/Validator/src/SupplierValidator.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/annotations/Validator/src/Validate.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/annotations/Validator/src/Validator.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/forkjoin/mergesort/MergeDemo.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/forkjoin/mergesort/MergeSort.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/jmx/jmx-scandir/docfiles/connect-local-java-jar.jpg
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/DirectoryScanner.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/DirectoryScannerMXBean.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/ResultLogManager.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/ResultLogManagerMXBean.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/ScanDirAgent.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/ScanDirClient.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/ScanDirConfig.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/ScanDirConfigMXBean.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/ScanManager.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/ScanManagerMXBean.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/config/DirectoryScannerConfig.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/config/FileMatch.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/config/ResultLogConfig.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/config/ResultRecord.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/config/ScanManagerConfig.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/config/XmlConfigUtils.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/jmx/jmx-scandir/test/com/sun/jmx/examples/scandir/DirectoryScannerTest.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/jmx/jmx-scandir/test/com/sun/jmx/examples/scandir/ScanDirConfigTest.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/jmx/jmx-scandir/test/com/sun/jmx/examples/scandir/ScanManagerTest.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/jmx/jmx-scandir/test/com/sun/jmx/examples/scandir/TestUtils.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/jmx/jmx-scandir/test/com/sun/jmx/examples/scandir/config/XmlConfigUtilsTest.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/lambda/BulkDataOperations/src/CSVProcessor.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/lambda/BulkDataOperations/src/Grep.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/lambda/BulkDataOperations/src/PasswordGenerator.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/lambda/BulkDataOperations/src/WC.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/lambda/DefaultMethods/ArrayIterator.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/lambda/DefaultMethods/DiamondInheritance.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/lambda/DefaultMethods/Inheritance.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/lambda/DefaultMethods/MixIn.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/lambda/DefaultMethods/Reflection.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/lambda/DefaultMethods/SimplestUsage.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/nio/chatserver/ChatServer.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/nio/chatserver/Client.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/nio/chatserver/ClientReader.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/nio/chatserver/DataReader.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/nio/chatserver/MessageReader.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/nio/chatserver/NameReader.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/nio/file/AclEdit.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/nio/file/Chmod.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/nio/file/Copy.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/nio/file/DiskUsage.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/nio/file/FileType.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/nio/file/WatchDir.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/nio/file/Xdd.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/nio/multicast/MulticastAddress.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/nio/multicast/Reader.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/nio/multicast/Sender.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/nio/server/AcceptHandler.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/nio/server/Acceptor.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/nio/server/B1.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/nio/server/BN.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/nio/server/BP.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/nio/server/ChannelIO.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/nio/server/ChannelIOSecure.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/nio/server/Content.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/nio/server/Dispatcher.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/nio/server/Dispatcher1.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/nio/server/DispatcherN.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/nio/server/FileContent.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/nio/server/Handler.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/nio/server/MalformedRequestException.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/nio/server/N1.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/nio/server/N2.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/nio/server/Reply.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/nio/server/Request.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/nio/server/RequestHandler.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/nio/server/RequestServicer.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/nio/server/Sendable.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/nio/server/Server.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/nio/server/StringContent.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/nio/server/URLDumper.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/scripting/scriptpad/src/com/sun/sample/scriptpad/Main.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/try-with-resources/src/CustomAutoCloseableSample.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/try-with-resources/src/Unzip.java
/snap/myapp/current/usr/share/doc/openjdk-8-jre-headless/examples/try-with-resources/src/ZipCat.java
/snap/myapp/current/usr/share/gdb/auto-load/usr/lib/jvm/java-8-openjdk-amd64
/snap/myapp/current/usr/share/java
/snap/myapp/current/usr/share/java/java_defaults.mk
/snap/myapp/current/usr/share/man/man8/update-java-alternatives.8.gz
chris@desktop:~$ 

you will, eventually, else your app wont have any access to any system resources once you switch it to strict…

I assumed ~/snap/myapp/common is designed as somewhere to store my data without having to give it permission to access the disk, and that it was accessed via $SNAP_USER_DATA - have now realised that it wouldn’t be very convenient for the user to have to put the file they want processing there though! I will put plugs: [home] back to give access to ~.

instead of cd’ing i’d try to use $SNAP and $SNAP_USER_DATA in the command

I know Linux but not Java, I’m Snapping the Java application for someone who knows Java but not Linux. Therefore I’d better compromise on your suggestion and use cd $SNAP in the shell file as I don’t want to mess with the command.

you first need to get JAVA_HOME and the PATH right to point to the correct dirs

Absolutely, trial and error is getting tedious. I need to put some effort into understanding this and looking at what’s where on the disk. Thanks for your patience.


#13

there we go, so the java binary is in the snap and should theoretically be found … /snap/myapp/current translates to $SNAP in the above … so try setting your JAVA_HOME to:

      JAVA_HOME: $SNAP/usr/lib/jvm/java-8-openjdk-amd64

in your snapcraft.yaml, that should help…

$SNAP_USER_DATA translates to ~/snap/myapp/current … if you want the “…/common” dir, you use $SNAP_USER_COMMON :wink:


#14

I made a silly mistake with the user data directory! Things seem to be getting further now, but I get this error:

Priming myapp 
Sorry, an error occurred in Snapcraft:
Traceback (most recent call last):
  File "/usr/bin/snapcraft", line 9, in <module>
    load_entry_point('snapcraft==2.43.1', 'console_scripts', 'snapcraft')()
  File "/usr/lib/python3/dist-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3/dist-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/snapcraft/cli/lifecycle.py", line 136, in snap
    project = _execute(steps.PRIME, parts=[], **kwargs)
  File "/usr/lib/python3/dist-packages/snapcraft/cli/lifecycle.py", line 35, in _execute
    lifecycle.execute(step, project_config, parts)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_runner.py", line 90, in execute
    executor.run(step, part_names)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_runner.py", line 196, in run
    self._create_meta(step, processed_part_names)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_runner.py", line 359, in _create_meta
    self.config.validator.schema,
  File "/usr/lib/python3/dist-packages/snapcraft/internal/meta/_snap_packaging.py", line 109, in create_snap_packaging
    packaging.write_snap_yaml()
  File "/usr/lib/python3/dist-packages/snapcraft/internal/meta/_snap_packaging.py", line 312, in write_snap_yaml
    snap_yaml = self._compose_snap_yaml()
  File "/usr/lib/python3/dist-packages/snapcraft/internal/meta/_snap_packaging.py", line 468, in _compose_snap_yaml
    snap_yaml["apps"] = self._wrap_apps(self._config_data["apps"])
  File "/usr/lib/python3/dist-packages/snapcraft/internal/meta/_snap_packaging.py", line 567, in _wrap_apps
    self._wrap_app(app, apps[app])
  File "/usr/lib/python3/dist-packages/snapcraft/internal/meta/_snap_packaging.py", line 575, in _wrap_app
    app[k] = self._wrap_exe(app[k], "{}-{}".format(k, name))
  File "/usr/lib/python3/dist-packages/snapcraft/internal/meta/_snap_packaging.py", line 546, in _wrap_exe
    with open(exepath, "rb") as exefile:
FileNotFoundError: [Errno 2] No such file or directory: '/root/build_myapp/prime/bin/myapp/myapp.sh'
We would appreciate it if you created a bug report at
https://launchpad.net/snapcraft/+filebug with the above text included.
Stopping local:snapcraft-jolly-light-pig

I won’t file a bug report because I’m sure it’s something I’ve done wrong.


#15

you need a part or something like and overrdie scriptlet (i.e. override-build:) that copies the file in place, it is simply not in the target dir of the build


#16

I’ve rewritten the snapcraft.yaml

export JAVA_HOME=$SNAP/usr/lib/jvm/java-8-openjdk-amd64
export PATH=$JAVA_HOME/jre/bin:$PATH

java -splash:splash.png -Xms512m -Xmx2048m -Dorg.myapp.scriptRun=true -Dfile.encoding=UTF-8 -cp myapp.jar:lib org.MYAPP.myappStarter

echo $SNAP

#example was:
#java -jar $SNAP/usr/share/doc/openjdk-8-demo/demo/jfc/FileChooserDemo/FileChooserDemo.jar

and it installs, shows in the list and can be started and it shows the applications flash screen - which is encouraging. It goes not any further though, as it errors with

Error: Could not find or load main class .snap.myapp.x7.org.myapp.MYAPPStarter

I need to give this some more thought as it finds the flash screen, it’s probably something to do with Java about the MYAPPstarter bit which I don’t understand.


#17

i’m not actually a java guy, but i think it wants you to set the --classpath option or the CLASSPATH environment variable pointing to where that specific class can be found …


#18

“cd $SNAP” in the myapp.sh seems to have fixed that.
Building myapp
gives a warning - but I’m not going to worry about this
/root/build_myapp/parts/java/install/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/cacerts will be a dangling symlink

Th app fails with the (verbose!) error below. I’m guessing that this is because it is trying to write to a configuration file, if not I think it is some sort of file access - which is in the Java, so I have submitted a request to the writer of the software to have a look. I’ll keep you posted, thanks for your much appreciated help so far.

chris@desktop:~$ myapp
19:52:24,540 DEBUG [main] myappStarter - Java version: 1.8.0_191-8u191-b12-0ubuntu0.16.04.1-b12 by Oracle Corporation
19:52:24,541 DEBUG [main] myappStarter - OS: Linux 4.15.0-43-generic
19:52:24,541  INFO [main] myappStarter - Starting myapp with working directory /snap/myapp/x12

(process:25267): Gtk-WARNING **: Locale not supported by C library.
	Using the fallback 'C' locale.
Gtk-Message: Failed to load module "pantheon-filechooser-module"
Gtk-Message: Failed to load module "canberra-gtk-module"
19:52:25,937 ERROR [main] myappStarter - Could not set Look&Feel
java.lang.NullPointerException
	at sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1264)
	at sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:219)
	at sun.awt.FontConfiguration.init(FontConfiguration.java:107)
	at sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:774)
	at sun.font.SunFontManager$2.run(SunFontManager.java:431)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.font.SunFontManager.<init>(SunFontManager.java:376)
	at sun.awt.FcFontManager.<init>(FcFontManager.java:35)
	at sun.awt.X11FontManager.<init>(X11FontManager.java:57)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at java.lang.Class.newInstance(Class.java:442)
	at sun.font.FontManagerFactory$1.run(FontManagerFactory.java:83)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74)
	at java.awt.Font.getFont2D(Font.java:491)
	at java.awt.Font.access$000(Font.java:224)
	at java.awt.Font$FontAccessImpl.getFont2D(Font.java:228)
	at sun.font.FontUtilities.getFont2D(FontUtilities.java:180)
	at sun.font.FontUtilities.getCompositeFontUIResource(FontUtilities.java:399)
	at com.sun.java.swing.plaf.gtk.PangoFonts.lookupFont(PangoFonts.java:204)
	at com.sun.java.swing.plaf.gtk.GTKLookAndFeel.getGTKStyleFactory(GTKLookAndFeel.java:1603)
	at com.sun.java.swing.plaf.gtk.GTKLookAndFeel.loadStyles(GTKLookAndFeel.java:1567)
	at com.sun.java.swing.plaf.gtk.GTKLookAndFeel.initialize(GTKLookAndFeel.java:1452)
	at javax.swing.UIManager.setLookAndFeel(UIManager.java:538)
	at javax.swing.UIManager.setLookAndFeel(UIManager.java:583)
	at org.myapp.myappStarter.main(Unknown Source)
19:52:25,997 DEBUG [Thread-1] myappStarter - Starting font pre-loading
Exception in thread "Thread-1" java.lang.ExceptionInInitializerError
	at org.myapp.myappStarter$2.run(Unknown Source)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
	at sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1264)
	at sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:219)
	at sun.awt.FontConfiguration.init(FontConfiguration.java:107)
	at sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:774)
	at sun.font.SunFontManager$2.run(SunFontManager.java:431)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.font.SunFontManager.<init>(SunFontManager.java:376)
	at sun.awt.FcFontManager.<init>(FcFontManager.java:35)
	at sun.awt.X11FontManager.<init>(X11FontManager.java:57)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at java.lang.Class.newInstance(Class.java:442)
	at sun.font.FontManagerFactory$1.run(FontManagerFactory.java:83)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74)
	at sun.java2d.SunGraphicsEnvironment.getFontManagerForSGE(SunGraphicsEnvironment.java:190)
	at sun.java2d.SunGraphicsEnvironment.getAvailableFontFamilyNames(SunGraphicsEnvironment.java:224)
	at sun.java2d.SunGraphicsEnvironment.getAvailableFontFamilyNames(SunGraphicsEnvironment.java:252)
	at org.myapp.swingframework.FontChooserComboBox.<clinit>(FontChooserComboBox.java:64)
	... 2 more
Exception in thread "main" java.lang.NullPointerException
	at javax.swing.MultiUIDefaults.getUIError(MultiUIDefaults.java:130)
	at javax.swing.UIDefaults.getUI(UIDefaults.java:761)
	at javax.swing.UIManager.getUI(UIManager.java:1016)
	at javax.swing.JPanel.updateUI(JPanel.java:126)
	at javax.swing.JPanel.<init>(JPanel.java:86)
	at javax.swing.JPanel.<init>(JPanel.java:109)
	at javax.swing.JPanel.<init>(JPanel.java:117)
	at javax.swing.JRootPane.createGlassPane(JRootPane.java:546)
	at javax.swing.JRootPane.<init>(JRootPane.java:366)
	at javax.swing.JFrame.createRootPane(JFrame.java:286)
	at javax.swing.JFrame.frameInit(JFrame.java:267)
	at javax.swing.JFrame.<init>(JFrame.java:234)
	at org.myapp.swing.gui.MainFrame.<init>(Unknown Source)
	at org.myapp.myappStarter.main(Unknown Source)

#19

it wants to load fonts and themes … if your app is a GUI app you will need to use a desktop launcher (or set up desktop related bits in the shell script like i do in jtiledownloader), enable the matching plugs in the apps entry and ship the right stage-packages for this …


#20

Good catch! This was written for Windows - but I turned it into a deb. It doesn’t use GTK or Qt but I’ve no idea where Java gets it’s GUI from. I have just found an old shell script for the deb version, which copies all the themes around and I remember there was a problem which that was created to solve.
I’m currently still waiting for “the writer of the software to have a look.”