在 Wayland 下的 Docker 容器中运行 Java Abstract Window Toolkit 应用程序

在 Wayland 下的 Docker 容器中运行 Java Abstract Window Toolkit 应用程序

在过去的几年里我通过运行以下命令在 Docker 容器中运行了 Java Swing 应用程序:

docker run -u 1000:1000 --rm --name etax_zug --hostname etax-zug \
  -e DISPLAY=unix:0 \
  -e XAUTHORITY=/tmp/xauth \
  -v $XAUTHORITY:/tmp/xauth \
  -v /tmp/.X11-unix:/tmp/.X11-unix etax_zug:latest

现在我切换到 Wayland,但它不再起作用了:

An error occurred:
java.lang.NoClassDefFoundError: Could not initialize class java.awt.GraphicsEnvironment$LocalGE
Error log: /tmp/install4jError18129787635997487010.log
java.lang.NoClassDefFoundError: Could not initialize class java.awt.GraphicsEnvironment$LocalGE
    at java.desktop/java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:129)
    at java.desktop/sun.awt.X11.XToolkit.<clinit>(XToolkit.java:232)
    at java.base/java.lang.Class.forName0(Native Method)
    at java.base/java.lang.Class.forName(Class.java:315)
    at java.desktop/java.awt.Toolkit$2.run(Toolkit.java:588)
    at java.desktop/java.awt.Toolkit$2.run(Toolkit.java:583)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.desktop/java.awt.Toolkit.getDefaultToolkit(Toolkit.java:582)
    at java.desktop/java.awt.Toolkit.getEventQueue(Toolkit.java:1494)
    at java.desktop/java.awt.EventQueue.isDispatchThread(EventQueue.java:1086)
    at com.install4j.runtime.installer.frontend.GUIHelper.invokeOnEDT(GUIHelper.java:436)
    at com.install4j.runtime.installer.frontend.headless.AbstractHeadlessScreenExecutor.init(AbstractHeadlessScreenExecutor.java:83)
    at com.install4j.runtime.installer.frontend.headless.ConsoleScreenExecutor.<init>(ConsoleScreenExecutor.java:25)
    at com.install4j.runtime.installer.frontend.headless.InstallerConsoleScreenExecutor.<init>(InstallerConsoleScreenExecutor.java:6)
    at com.install4j.runtime.installer.Installer.getScreenExecutor(Installer.java:84)
    at com.install4j.runtime.installer.Installer.runInProcess(Installer.java:60)
    at com.install4j.runtime.installer.Installer.main(Installer.java:46)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:84)
    at com.install4j.runtime.launcher.UnixLauncher.start(UnixLauncher.java:69)
    at install4j.Installer3606950382.main(Unknown Source)

我如何才能在 Wayland 下也实现此功能?

如果您是,则会获得奖励业力积分创建拉取请求这个解决方案也适用于 Podman。 ;)

相关内容