.jar 文件无法在 fedora gnome3 上启动

.jar 文件无法在 fedora gnome3 上启动

表单终端,当我尝试运行 .jar 文件时,我收到:

$ java -jar ./RemoteDroidServer/RemoteDroidServer.jar 
Exception in thread "main" java.awt.HeadlessException
    at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:204)
    at java.awt.Window.<init>(Window.java:536)
    at java.awt.Frame.<init>(Frame.java:420)
    at java.awt.Frame.<init>(Frame.java:385)
    at AppFrame.<init>(AppFrame.java:42)
    at RemoteDroidServer.main(RemoteDroidServer.java:16)
$

在具有 LX 桌面环境的 Devian 下,相同的文件运行没有问题:

$ java -jar ./RemoteDroidServer/RemoteDroidServer.jar 
Linux

系统信息

$ uname -a   
Linux fedora 5.5.10-200.fc31.x86_64 #1 SMP Wed Mar 18 14:21:38 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

安装了相关软件包

# rpm -qa | grep -a "jdk"
java-1.8.0-openjdk-headless-1.8.0.242.b08-0.fc31.x86_64
copy-jdk-configs-3.7-4.fc31.noarch
java-latest-openjdk-13.0.2.8-1.rolling.fc31.x86_64
java-11-openjdk-headless-11.0.6.10-0.fc31.x86_64
java-11-openjdk-11.0.6.10-0.fc31.x86_64
java-latest-openjdk-headless-13.0.2.8-1.rolling.fc31.x86_64

# rpm -qa | grep -a "java"
java-1.8.0-openjdk-headless-1.8.0.242.b08-0.fc31.x86_64
javapackages-filesystem-5.3.0-6.fc31.noarch
abrt-java-connector-1.1.4-1.fc31.x86_64
java-latest-openjdk-13.0.2.8-1.rolling.fc31.x86_64
tzdata-java-2019c-2.fc31.noarch
java-11-openjdk-headless-11.0.6.10-0.fc31.x86_64
java-11-openjdk-11.0.6.10-0.fc31.x86_64
java-latest-openjdk-headless-13.0.2.8-1.rolling.fc31.x86_64

GitHub 和 GoogleCode 上的 RemoteDroidServer:

https://github.com/alrusdi/remotedroid/tree/master/RemoteDroidServer/src
https://github.com/attilla/remotedroid/tree/master/RemoteDroidServer
https://code.google.com/archive/p/remotedroid/

根据评论更新

# java -version
openjdk version "1.8.0_242"
OpenJDK Runtime Environment (build 1.8.0_242-b08)
OpenJDK 64-Bit Server VM (build 25.242-b08, mixed mode)
# cd RemoteDroidServer/ && java -jar RemoteDroidServer.jar
Exception in thread "main" java.awt.HeadlessException
    at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:204)
    at java.awt.Window.<init>(Window.java:536)
    at java.awt.Frame.<init>(Frame.java:420)
    at java.awt.Frame.<init>(Frame.java:385)
    at AppFrame.<init>(AppFrame.java:42)
    at RemoteDroidServer.main(RemoteDroidServer.java:16)

最新更新

由于其他原因,我决定尝试 KDE-Plasma,令我惊讶的是,.jar 程序适用于此 DE!

答案1

我在 Mobian-LXDE 系统上的 AWT 库也遇到了同样的问题(https://wiki.mobian-project.org/doku.php?id=desktopenvironments#lxde)。解决方案就像安装default-jre软件包一样简单。

学分转到:
https://stackoverflow.com/questions/5241850/running-java-gui-applications-through-a-linux-terminal/5242043#5242043

我还没有机会在 fedora-GNOME 上进行测试。


更新

这个问题似乎同时dnf update在我的 fedora-GNOME 上彻底消失了,或者是通过一个 KDE-Plasma-5 相关的软件包解决的,该软件包是通过两个桌面环境安装/更新的。

相关内容