Exception in thread "main" java.awt.AWTError: Can't connect to X11 window server using 'localhost:10.0' as the value of the DISPLAY variable

downloaded the latest 0.35.2, and run java -jar metabase.jar, it failed to work and the error is:
04-14 22:27:09 INFO util.encryption :: Saved credentials encryption is DISABLED for this Metabase instance. :unlock:
For more information, see https://metabase.com/docs/latest/operations-guide/encrypting-database-details-at-rest.html
Exception in thread “main” java.awt.AWTError: Can’t connect to X11 window server using ‘localhost:10.0’ as the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at sun.awt.X11GraphicsEnvironment.access$200(X11GraphicsEnvironment.java:65)
at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:115)
at java.security.AccessController.doPrivileged(Native Method)
at sun.awt.X11GraphicsEnvironment.(X11GraphicsEnvironment.java:74)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:103)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:82)
at metabase.pulse.render.png$fn__33082$fn__33083.invoke(png.clj:33)
at clojure.lang.Delay.deref(Delay.java:42)
at clojure.core$deref.invokeStatic(core.clj:2320)

my enviornment:
java version “1.8.0_211”

it worked fine when using 0.30.0 before.

Hi @luoluo
Make sure you’re not using a headless Java version. I would recommend AdoptOpenJDK:
https://adoptopenjdk.net/releases.html?variant=openjdk11&jvmVariant=hotspot

Hi @flavoura,
I checked the environment and uninstall all the javaheadless* packages, and also downloaded the AdoptOpenJDK from the link you provided, but the error still exists.
it happens on centos7.5. 3.10.0-862.el7.x86_64

@luoluo Make sure that the correct Java is being used - check by running
java -XshowSettings:properties -version
You can see this issue for more details - seems like the older Centos might need a little nudging to get it working:
https://github.com/metabase/metabase/issues/12223

@flamber,
Thanks for your help. The error disappeared after installing xmanager

here is the detailed java version and properties:
Property settings:
awt.toolkit = sun.awt.X11.XToolkit
file.encoding = UTF-8
file.encoding.pkg = sun.io
file.separator = /
java.awt.graphicsenv = sun.awt.X11GraphicsEnvironment
java.awt.printerjob = sun.print.PSPrinterJob

java version “1.8.0_211”
Java™ SE Runtime Environment (build 1.8.0_211-b12)
Java HotSpot™ 64-Bit Server VM (build 25.211-b12, mixed mode)

Regards,

@luoluo You might have downloaded AdoptOpenJDK, but it’s not installed correctly, since you’re still using Oracle Java 8. Anyways, you got it working, so that’s good.

@flamber you know, I tried Oracle Java 8 and AdoptOpenJDK , both of them will introduce that kind of error before installing xmanager.
some details:
[tcn@sfx-11-202 software]$ /usr/java/jdk-11.0.6+10-jre/bin/java -version
openjdk version “11.0.6” 2020-01-14
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.6+10)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.6+10, mixed mode)
run:
/usr/java/jdk-11.0.6+10-jre/bin/java -jar metabase.jar

[tcn@sfx-11-202 software]$ java -version
java version “1.8.0_211”
Java™ SE Runtime Environment (build 1.8.0_211-b12)
Java HotSpot™ 64-Bit Server VM (build 25.211-b12, mixed mode)

run: java -jar metabase.jar

am I right ?

Thanks,

@luoluo Okay, interesting. Must be something to do with Centos 7 or your specific setup.

:grinning: