Closed calgara12 closed 9 months ago
Did you install the package which provides libswt-gtk*.so
libraries?
Yeah, my Dockerfile looks like:
FROM jlesage/baseimage-gui:ubuntu-18.04
# Install xterm.
RUN apt-get update && apt-get install -y openjdk-8-jre libswt-gtk*
# Copy the start script.
COPY nitro.jar /app/
COPY startapp.sh /startapp.sh
# Set the name of the application.
ENV APP_NAME="Nitroexplorer"
Maybe you could try to install it on a normal Linux installation to see how the app is started. They are often started with a couple of java options...
I'm having a similar problem: I'm getting errors related to /dev/null as well. I'm trying to make an image that loads Eclair GUI, and (part of) the traceback is the following:
Loading library prism_es2 from resource failed: java.io.IOException: Can not create cache at /dev/null/.openjfx/cache/[168/1841]
java.io.IOException: Can not create cache at /dev/null/.openjfx/cache/11.0.2
at com.sun.glass.utils.NativeLibLoader.cacheLibrary(NativeLibLoader.java:233)
at com.sun.glass.utils.NativeLibLoader.installLibraryFromResource(NativeLibLoader.java:203)
at com.sun.glass.utils.NativeLibLoader.loadLibraryFromResource(NativeLibLoader.java:185) at com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:157)
at com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:52)
at com.sun.prism.es2.ES2Pipeline.lambda$static$0(ES2Pipeline.java:68)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at com.sun.prism.es2.ES2Pipeline.<clinit>(ES2Pipeline.java:50)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:315)
at com.sun.prism.GraphicsPipeline.createPipeline(GraphicsPipeline.java:187)
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:834)
Loading library prism_sw from resource failed: java.io.IOException: Can not create cache at /dev/null/.openjfx/cache/11.0.2
java.io.IOException: Can not create cache at /dev/null/.openjfx/cache/11.0.2
at com.sun.glass.utils.NativeLibLoader.cacheLibrary(NativeLibLoader.java:233)
at com.sun.glass.utils.NativeLibLoader.installLibraryFromResource(NativeLibLoader.java:203)
at com.sun.glass.utils.NativeLibLoader.loadLibraryFromResource(NativeLibLoader.java:185)
at com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:157)
at com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:52)
at com.sun.prism.sw.SWPipeline.lambda$static$0(SWPipeline.java:42)
at java.base/java.security.AccessController.doPrivileged(Native Method)
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:315)
at com.sun.prism.GraphicsPipeline.createPipeline(GraphicsPipeline.java:187)
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:834)
As we can see, it also uses /dev/null as a directory. I'm currently trying on the ubuntu-18.04 tag with openjdk-11, but also tried debian-9 and manually downloading openjdk-11 from AdoptOpenJDK.
I tried running the JAR on a Docker container with Lubuntu + VNC and started correctly with no errors.
So, It might have something to do with some Java option, maybe is trying to write on the /home directory and by some reason it defaults it to /dev/null? Kinda weird.
@calgara12 The problem seems to be that this image uses a user with no HOME route (more like the home set to /dev/null), which causes these errors (check this: https://github.com/jlesage/docker-baseimage-gui#home-environment-variable).
Theorically we can set the home in Java like this (here I show my startapp.sh file):
#!/bin/sh
set -ex
HOME="/tmp"
_JAVA_OPTIONS="-Duser.home=${HOME}" exec java -verbose -jar /eclair.jar
In my case another errors show up, but at least is not showing problems related with /dev/null. Maybe it works for you.
(Haven't tried yet setting the HOME env var before running the java command)
similar here: The Application is using eclipse and trys to write to /dev/null/.eclipse... I tried changing Home to /config but no luck. Any Ideas how I can make him not using /dev/null?
For openjfx cache, I had same issue. This option fixes it...
-Djavafx.cachedir=/tmp
java -jar \
-Djavafx.cachedir=/tmp \
-Duser.home=/tmp \
This should fix your issues
Closing this issue. Please re-open if needed.
Hey, I'm trying to run Nitro Explorer 3 inside this container. The container always exits immediately throwing the error:
I have tried alpine, debian and ubuntu, i always get this message.
My basic approach is this: Inside the Dockerfile
Inside the startapp.sh: /usr/bin/java -jar /opt/nitro/myapp.jar
A lot of hours have gone into this and I don't know what I could possibly do to make this work. If you could assist me, that would be awesome.
Thanks!