Make sure that you are not using a headless version of Java. I would recommend AdoptOpenJDK:
https://adoptopenjdk.net/releases.html?variant=openjdk11&jvmVariant=hotspot
If you’re using Centos, then you might need to install xmanager
:
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
For reference: https://github.com/metabase/metabase/issues/12223