I am attempting to run a Java GUI Application inside of a Container on Pop!_OS.
This should also work on Fedora, or other distributions.
I think it requires that the user be running Xorg X11 so you can get the sockets for it.
I'm not sure if Xwayland provides the same kind of connectivity.
The following snippets below are the individual pieces, but this markdown file will have all the same stuff.
- Container management tool
- Podman
- Docker
Pull down the OpenJDK Image.
podman pull docker.io/library/openjdk:17.0.1-bullseyeLaunch the container using:
#!/usr/bin/env bash
podman run \
--rm \
-it \
--network=host \
--env=DISPLAY \
--volume="/tmp/.X11-unix:/tmp/.X11-unix" \
--volume="$(pwd):/app" \
--workdir="/app" \
docker.io/library/openjdk:17.0.1-bullseye \
/bin/bashBecause I am exploring this so far, we'll install a few packages in the container. Once I get this figured out, I'll put it all in a Containerfile.
#!/usr/bin/env bash
apt update
apt install --yes libxext6 libxrender1 libxtst6 openjfxNow, we'll try running the application.
java -Djavafx.verbose=true -Dprism.verbose=true -Xmx4G -Dprism.maxvram=3G -jar worldographer.jar Here is the command with the errors.
root@pop-os:/app# java -Djavafx.verbose=true -Dprism.verbose=true -Xmx4G -Dprism.maxvram=3G -jar worldographer.jar
Prism pipeline init order: es2 sw
Using Double Precision Marlin Rasterizer
Using dirty region optimizations
Not using texture mask for primitives
Not forcing power of 2 sizes for textures
Using hardware CLAMP_TO_ZERO mode
Opting in for HiDPI pixel scaling
Prism pipeline name = com.sun.prism.es2.ES2Pipeline
GraphicsPipeline.createPipeline failed for com.sun.prism.es2.ES2Pipeline
java.lang.ClassNotFoundException: com.sun.prism.es2.ES2Pipeline
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:375)
at com.sun.prism.GraphicsPipeline.createPipeline(GraphicsPipeline.java:218)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:91)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
at java.base/java.lang.Thread.run(Thread.java:833)
*** Fallback to Prism SW pipeline
Prism pipeline name = com.sun.prism.sw.SWPipeline
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: /app/libprism_sw.so
GraphicsPipeline.createPipeline failed for com.sun.prism.sw.SWPipeline
java.lang.UnsatisfiedLinkError: no prism_sw in java.library.path: /usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2429)
at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:818)
at java.base/java.lang.System.loadLibrary(System.java:1989)
at com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:163)
at com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:53)
at com.sun.prism.sw.SWPipeline.lambda$static$0(SWPipeline.java:42)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
at com.sun.prism.sw.SWPipeline.<clinit>(SWPipeline.java:41)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:375)
at com.sun.prism.GraphicsPipeline.createPipeline(GraphicsPipeline.java:218)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:91)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
at java.base/java.lang.Thread.run(Thread.java:833)
Graphics Device initialization failed for : es2, sw
Error initializing QuantumRenderer: no suitable pipeline found
java.lang.RuntimeException: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
at com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:280)
at com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:244)
at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:261)
at javafx.scene.image.Image.loadImage(Image.java:1078)
at javafx.scene.image.Image.initialize(Image.java:813)
at javafx.scene.image.Image.<init>(Image.java:703)
at com.inkwellideas.ographer.model.TerrainType.setupDefaults(TerrainType.java:111)
at com.inkwellideas.ographer.model.Terrain.<clinit>(Terrain.java:16)
at com.inkwellideas.ographer.ui.Worldographer.main(Worldographer.java:12960)
at com.inkwellideas.ographer.ui.Launcher.main(Launcher.java:122)
Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:94)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
at java.base/java.lang.Thread.run(Thread.java:833)
Exception in thread "main" java.lang.ExceptionInInitializerError
at com.inkwellideas.ographer.ui.Worldographer.main(Worldographer.java:12960)
at com.inkwellideas.ographer.ui.Launcher.main(Launcher.java:122)
Caused by: java.lang.RuntimeException: No toolkit found
at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:273)
at javafx.scene.image.Image.loadImage(Image.java:1078)
at javafx.scene.image.Image.initialize(Image.java:813)
at javafx.scene.image.Image.<init>(Image.java:703)
at com.inkwellideas.ographer.model.TerrainType.setupDefaults(TerrainType.java:111)
at com.inkwellideas.ographer.model.Terrain.<clinit>(Terrain.java:16)
... 2 moreWhat the application window looks like:

Another link to reference later: https://inkwellideas.com/forums/topic/worldographer-wont-launch-with-openjdk/