Java application shows and error when trying to play sound

Hi @popey

I tried your solution (pulseaudio -> audio-playback) but now I get errors about xprop, which is weird since I have x11-utils as a stage package:

$ snap run jgalaxian
openjdk version "1.8.0_265"
OpenJDK Runtime Environment (build 1.8.0_265-8u265-b01-0ubuntu2~18.04-b01)
OpenJDK 64-Bit Server VM (build 25.265-b01, mixed mode)
java.io.IOException: Cannot run program "/usr/bin/xprop": error=2, No such file or directory

The only change I made was to change pulseaudio to audio-playback, so that seems fishy to me. xprop is in fact present in the snap:

 ls -l /snap/jgalaxian/current/usr/bin/xprop
 -rwxr-xr-x 1 root root 41256 Apr 21  2017 /snap/jgalaxian/current/usr/bin/xprop*

This tells me that something in the stack trace is calling this as a hard-coded path and not with ${SNAP}/usr/bin/xprop, right?. But this is a diversion because . . .

I switched to use openjdk-11 instead, which solved the xprop issue, which is good news. But there is still no sound using the audio-playback plug with the same error others have found:

Unable to start audio mixer. java.lang.IllegalArgumentException: No line matching interface SourceDataLine supporting format PCM_SIGNED 44100.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian is supported.

Could this be simply a bug in snap/snapcraft?