JDK installed headless so graphical programs don't start

Hello,

I’m using F43 and I want to use Geogebra 5 but when I start it, I get this error:

Exception in thread "main" java.awt.HeadlessException: 
No X11 DISPLAY variable was set,
or no headful library support was found,
but this program performed an operation which requires it.
	at java.desktop/java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:158)
	at java.desktop/java.awt.Window.<init>(Window.java:518)
	at java.desktop/java.awt.Frame.<init>(Frame.java:428)
	at java.desktop/java.awt.Frame.<init>(Frame.java:393)
	at org.geogebra.desktop.b.a(Unknown Source)
	at org.geogebra.desktop.GeoGebra.a(Unknown Source)
	at org.geogebra.desktop.GeoGebra3D.main(Unknown Source)

I used to revert to openjdk-17 to bypass this error (solution I found on the web) but it is not available anymore; how can I solve that? Thanks!

Install the full version. The headless version does not support audio and video.

e.g.
list what is installed rpm -qa java\* or dnf list java\* --installed
list what’s available dnf list java\* --available

install with sudo dnf install package_name e.g. sudo dnf install java-21-openjdk

1 Like

Thanks for your answer. However, the headless package installed automatically when I installed java-latest-jdk.

rpm -qa java\* gives

javapackages-filesystem-6.4.1-4.fc43.noarch
javascriptcoregtk4.1-2.50.4-1.fc43.x86_64
javascriptcoregtk6.0-2.50.4-1.fc43.x86_64
java-srpm-macros-1-7.fc43.noarch
java-25-openjdk-crypto-adapter-25.0.1.0.8-3.fc43.x86_64
java-25-openjdk-headless-25.0.1.0.8-3.fc43.x86_64
javapackages-tools-6.4.1-4.fc43.noarch
java-latest-openjdk-crypto-adapter-25.0.1.0.8-0.3.fc43.x86_64
java-latest-openjdk-headless-25.0.1.0.8-0.3.fc43.x86_64
java-latest-openjdk-25.0.1.0.8-0.3.fc43.x86_64

If I try to remove java-latest-openjdk-headless, it also wants to remove java-latest-openjdk. And when I reinstall java-latest-openjdk, it reinstalls java-latest-openjdk-headless.

It doesn’t seem that I have a package that needs the headless java, since trying to uninstall it doesn’t list anything else than java packages in the dependencies:

# dnf remove java-latest-openjdk-headless
Package                                Arch      Version                              Repository              Size
Removing:
 java-latest-openjdk-headless          x86_64    1:25.0.1.0.8-0.3.fc43                updates            236.4 MiB
Removing dependent packages:
 java-latest-openjdk                   x86_64    1:25.0.1.0.8-0.3.fc43                updates            953.7 KiB
Removing unused dependencies:
 java-latest-openjdk-crypto-adapter    x86_64    1:25.0.1.0.8-0.3.fc43                updates            504.5 KiB
 ttmkfdir                              x86_64    3.0.9-73.fc43                        fedora             122.5 KiB
 xorg-x11-fonts-Type1                  noarch    7.5-41.fc43                          fedora             863.3 KiB

I haven’t seen a package like java-latest-openjdk-full or java-latest-openjdk-headfull
so I seem stuck.

Thanks again!

java-21-openjdk wll install the missing files for GUI support.

$ rpm -q --requires java-21-openjdk
[deleted]
fontconfig(x86-64)
java-21-openjdk-headless(x86-64) = 1:21.0.9.0.10-1.fc43
libX11.so.6()(64bit)
libXcomposite(x86-64)
libXext.so.6()(64bit)
libXi.so.6()(64bit)
libXrender.so.1()(64bit)
libXtst.so.6()(64bit)
libc.so.6()(64bit)
[deleted]
libc.so.6(GLIBC_ABI_DT_RELR)(64bit)
libjava.so()(64bit)
libm.so.6()(64bit)
libm.so.6(GLIBC_2.2.5)(64bit)
libm.so.6(GLIBC_2.29)(64bit)
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(PayloadIsZstd) <= 5.4.18-1
rtld(GNU_HASH)
xorg-x11-fonts-Type1

But you don’t need all that, because GeoGebra-Linux-Portable-5-4-911-3.tar.bz2 comes with its own java runtime (zulu).
Extract, set executable permissions where needed and viola

1 Like