You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PCGen fails to start on Fedora Silverblue (Toolbox) due to missing X11/HeadlessException #7334
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
Expected behavior
PCGen should start in the simulated X11 environment provided by xvfb-run, or at least gracefully detect a headless environment.
Environment:
OS: Fedora Silverblue (Immutable OS)
Execution: via toolbox container (Fedora base)
PCGen version: v6.08.00 RC8
Java version: OpenJDK 17
xorg-x11-server-Xvfb installed and xvfb-run available
I don't have a definitive answer/fix for this, but GPT4o suggested the following, YMMV:
You’re encountering a java.awt.HeadlessException when running PCGen inside a Fedora Silverblue Toolbox container using xvfb-run. Despite xvfb-run usually simulating a display, Java isn’t detecting it properly here. This is likely due to one or more of the following:
🔍 Diagnosis
1. DISPLAY variable not properly set within the toolbox environment or not visible to Java.
2. xvfb-run not properly wrapping the application, or some additional dependency is missing.
3. Java headless mode incorrectly enabled or defaulting due to environment.
⸻
✅ Suggested Fixes
Here’s a step-by-step checklist that should resolve the issue:
⸻
Install missing packages inside toolbox
Ensure your toolbox container has the following installed:
Also, ensure xvfb-run is available (some Fedora base containers may not include it by default).
⸻
Use xvfb-run with explicit Java invocation
Rather than using ./pcgen.sh directly, run the Java command explicitly via xvfb-run. PCGen’s shell script often wraps Java internally, which can interfere with environment vars.
Just to isolate whether it’s the Toolbox container causing the problem, try running the same xvfb-run command directly on Silverblue (outside toolbox). If it works there, the issue likely stems from isolation, permissions, or X11 socket access inside the container.
⸻
🛠 Bonus: Check for X11 libs
Ensure your toolbox container has X11 libraries needed for GUI applications:
sudo dnf install libXrender libXext libXtst libXi
⸻
Let me know what you get when you try xvfb-run java -Djava.awt.headless=false -jar pcgen.jar — that’s usually the most direct workaround.
Failed to resolve the transaction:
Package "xorg-x11-server-Xvfb-21.1.16-1.fc42.x86_64" is already installed.
Package "xorg-x11-xauth-1:1.1.3-3.fc42.x86_64" is already installed.
No match for argument: xorg-x11-utils
I don't know exactly why it no longer works. Some time ago I was still able to start it
xvfb-run bash -c 'echo $DISPLAY; java -jar pcgen.jar'
:99
17:08:30.54 INFO main Main:138 Starting PCGen v6.08.00 RC8
17:08:30.76 INFO main LanguageBundle:134 Initialising language bundle with locale en_US.
17:08:30.104 SEVERE main Main:484 Uncaught error - ignoring
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/sun.awt.HeadlessToolkit.getScreenSize(HeadlessToolkit.java:186)
at pcgen.gui2.plaf.LookAndFeelManager.initLookAndFeel(LookAndFeelManager.java:142)
at pcgen.system.Main.configureUI(Main.java:273)
at pcgen.system.Main.startupWithGUI(Main.java:228)
at pcgen.system.Main.main(Main.java:157)
xvfb-run java -Djava.awt.headless=false -jar pcgen.jar
Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't load library: /usr/lib/jvm/java-21-openjdk/lib/libawt_xawt.so
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2422)
at java.base/java.lang.Runtime.load0(Runtime.java:852)
at java.base/java.lang.System.load(System.java:2025)
at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:331)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:197)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:139)
at java.base/jdk.internal.loader.NativeLibraries.findFromPaths(NativeLibraries.java:259)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:249)
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2427)
at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:916)
at java.base/java.lang.System.loadLibrary(System.java:2063)
at java.desktop/java.awt.Toolkit$2.run(Toolkit.java:1384)
at java.desktop/java.awt.Toolkit$2.run(Toolkit.java:1382)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:319)
at java.desktop/java.awt.Toolkit.loadLibraries(Toolkit.java:1381)
at java.desktop/java.awt.Toolkit.initStatic(Toolkit.java:1419)
at java.desktop/java.awt.Toolkit.<clinit>(Toolkit.java:1393)
at pcgen.util.Logging.<clinit>(Logging.java:51)
at pcgen.system.Main.main(Main.java:138)
Hello, update on OpenJDK 21: I upgraded my distro and now run OpenJDK 21 (debian). No issue in sight. So it may just be Red Hat's flavor that is problematic, or a user issue.
I just came across this in my new Fedora 44 install. It turns out that by default Fedora 44 only installs the headless version of openjdk. I had to sudo dnf install java-25-openjdk
to get it working. Not sure how you do that in Silverblue but hopefully that helps.
@CodePhase, can you please try to check with master a command ./gradlew run?
I think, I have changed the build script in a way that the downloaded JDK is used for running the app.
Activity
karianna commentedon May 26, 2025
I don't have a definitive answer/fix for this, but GPT4o suggested the following, YMMV:
You’re encountering a java.awt.HeadlessException when running PCGen inside a Fedora Silverblue Toolbox container using xvfb-run. Despite xvfb-run usually simulating a display, Java isn’t detecting it properly here. This is likely due to one or more of the following:
🔍 Diagnosis
1. DISPLAY variable not properly set within the toolbox environment or not visible to Java.
2. xvfb-run not properly wrapping the application, or some additional dependency is missing.
3. Java headless mode incorrectly enabled or defaulting due to environment.
⸻
✅ Suggested Fixes
Here’s a step-by-step checklist that should resolve the issue:
⸻
Ensure your toolbox container has the following installed:
sudo dnf install xorg-x11-server-Xvfb xorg-x11-xauth xorg-x11-utils
Also, ensure xvfb-run is available (some Fedora base containers may not include it by default).
⸻
Rather than using ./pcgen.sh directly, run the Java command explicitly via xvfb-run. PCGen’s shell script often wraps Java internally, which can interfere with environment vars.
Example:
xvfb-run java -jar pcgen.jar
Or if PCGen uses a main class and classpath:
xvfb-run java -cp .:path/to/libs/* pcgen.core.Main
⸻
To verify that DISPLAY is being set properly inside xvfb-run, you can debug like this:
xvfb-run bash -c 'echo $DISPLAY; java -jar pcgen.jar'
If DISPLAY is blank or not a valid X11 socket, then xvfb-run isn’t initializing correctly.
⸻
Sometimes Java assumes a headless environment unless explicitly told otherwise:
xvfb-run java -Djava.awt.headless=false -jar pcgen.jar
⸻
If xvfb-run continues to fail, as a fallback, run PCGen in a nested X server like Xephyr. From host:
Xephyr :1 -screen 1024x768 &
Then in your toolbox:
export DISPLAY=:1
java -Djava.awt.headless=false -jar pcgen.jar
⸻
🧪 Test Outside Toolbox
Just to isolate whether it’s the Toolbox container causing the problem, try running the same xvfb-run command directly on Silverblue (outside toolbox). If it works there, the issue likely stems from isolation, permissions, or X11 socket access inside the container.
⸻
🛠 Bonus: Check for X11 libs
Ensure your toolbox container has X11 libraries needed for GUI applications:
sudo dnf install libXrender libXext libXtst libXi
⸻
Let me know what you get when you try xvfb-run java -Djava.awt.headless=false -jar pcgen.jar — that’s usually the most direct workaround.
Tealk commentedon May 26, 2025
xorg seems to be already installed:
I don't know exactly why it no longer works. Some time ago I was still able to start it
karianna commentedon May 27, 2025
@Tealk Did you try the other 4 diagnosis steps? What was the outcome of those?
Tealk commentedon May 27, 2025
yes:
karianna commentedon May 29, 2025
Really not sure in that case sorry :-(
xrogaan commentedon Aug 9, 2025
You say you use OpenJDK 17, but that last post refer to OpenJDK 21. Do you perhaps have a misconfigured java install?
Tealk commentedon Aug 9, 2025
The current version of Java in the Fedora toolbox:
However, I was able to work around the problem by using the distro box with a Debian VM. I installed Java 11 there.
xrogaan commentedon Aug 9, 2025
Works fine for me through OpenJDK 17. Either RedHat's OpenJDK does weird things or Java 21 can't run the software.
xrogaan commentedon Aug 13, 2025
Hello, update on OpenJDK 21: I upgraded my distro and now run OpenJDK 21 (debian). No issue in sight. So it may just be Red Hat's flavor that is problematic, or a user issue.
To be certain, could @Tealk try out termurin's OpenJDK? https://adoptium.net/installation/linux#centosrhelfedora-instructions
CodePhase commentedon Jun 12, 2026
I just came across this in my new Fedora 44 install. It turns out that by default Fedora 44 only installs the headless version of openjdk. I had to
sudo dnf install java-25-openjdkto get it working. Not sure how you do that in Silverblue but hopefully that helps.
Vest commentedon Jun 15, 2026
@CodePhase, can you please try to check with
mastera command./gradlew run?I think, I have changed the build script in a way that the downloaded JDK is used for running the app.