Code Monkey home page Code Monkey logo

Comments (9)

jlesage avatar jlesage commented on June 16, 2024

Did you install the package which provides libswt-gtk*.so libraries?

from docker-baseimage-gui.

calgara12 avatar calgara12 commented on June 16, 2024

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"

from docker-baseimage-gui.

jlesage avatar jlesage commented on June 16, 2024

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...

from docker-baseimage-gui.

David-Lor avatar David-Lor commented on June 16, 2024

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.

from docker-baseimage-gui.

David-Lor avatar David-Lor commented on June 16, 2024

@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)

from docker-baseimage-gui.

Loader23 avatar Loader23 commented on June 16, 2024

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?

from docker-baseimage-gui.

masterfwadmin avatar masterfwadmin commented on June 16, 2024

For openjfx cache, I had same issue. This option fixes it...

-Djavafx.cachedir=/tmp

from docker-baseimage-gui.

mitchweaver avatar mitchweaver commented on June 16, 2024
java -jar \
    -Djavafx.cachedir=/tmp \
    -Duser.home=/tmp \

This should fix your issues

from docker-baseimage-gui.

jlesage avatar jlesage commented on June 16, 2024

Closing this issue. Please re-open if needed.

from docker-baseimage-gui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.