Unix & Linux
fedora gnome3 java
Updated Fri, 27 May 2022 15:42:13 GMT

.jar-file fails to start on fedora gnome3


form terminal, when I try to run a .jar-file I receive:

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

under Devian with LX Desktop Environment the same file runs without problem:

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

System-info

$ 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

relevant packages installed

# 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

RemoteDroidServer on GitHub and GoogleCode:

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

Update based on comments

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

Newest Update

I decided to try KDE-Plasma for other reasons and to my surprise, the .jar-Program works with this DE!!




Solution

I had the same problem with the AWT-library on a Mobian-LXDE-System (https://wiki.mobian-project.org/doku.php?id=desktopenvironments#lxde). The solution was as simple as installing the default-jre package.

Credits go to:
/8xygq5/running-java-gui-applications-through-a-linux-terminal

I have not had the chance to test on fedora-GNOME.


UPDATE

the problem seems to have disapperes in the meanwhile thorough dnf update on my fedora-GNOME or it was solved by a KDE-Plasma-5-related package that was installed/updated by having two desktop environments.







External Links

External links referenced by this document:

Linked Articles

Local articles referenced by this article: