0

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!!

13
  • Have you tried to run the jar in headless mode? java -Djava.awt.headless=true -jar ./RemoteDroidServer/RemoteDroidServer.jar
    – Freddy
    Mar 25, 2020 at 10:46
  • @Freddy: I just did and the result is the same...
    – scjorge
    Mar 25, 2020 at 10:52
  • 1
    Ah, RemoteDroidServer is a gui app, right? What's the output of java -version? Is it 1.8.0.242?
    – Freddy
    Mar 25, 2020 at 11:14
  • $ cd RemoteDroidServer/ && java -jar RemoteDroidServer.jar .... and the GUI opens. Mar 25, 2020 at 11:15
  • 1
    Install java-1.8.0-openjdk-1.8.0.242.b08-0.fc31.x86_64 or select a different java version.
    – Freddy
    Mar 25, 2020 at 11:32

1 Answer 1

0

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:
https://stackoverflow.com/questions/5241850/running-java-gui-applications-through-a-linux-terminal/5242043#5242043

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .