When I try to print from a java application I get this error message:
Caused by: java.io.IOException: Cannot run program "/usr/bin/lpr": error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
I added cups-bsd to the snap and lpr is availalble in $SNAP/usr/bin/lpr.
But in the JDK in PSPrinterJob.java the path of lpr is hardcoded and expected to be /usr/bin/lpr
(from PSPrinterJob.java in openjdk 11)
The layout feature should be able to help you with this: Layouts: re-mapping snap directories. The feature is new, currently behind a feature flag and that page doesn’t mention using layouts with files, but it supports them. If you have trouble with the feature, talk to @zyga-snapd.
@zyga-snapd - I can’t find a ‘doc’ page on layouts-- is there a topic where its use is fully described?
Have you found a way to print from java inside snap? My application works without any issues printing with DEB, RPM and even flatpak I just can’t get it to print in snap.