Fix a Java app opening as a blank grey box that never draws
The primary fix is right and well-sourced. The Arch Java wiki describes the AWT hardcoded non-reparenting WM list, the gray-blob symptom and the menus-close-immediately symptom, and prescribes _JAVA_AWT_WM_NONREPARENTING=1. The -Dsun.awt.disablegrab=true JavaFX debugging freeze is also on that page. The defect is the AWT_TOOLKIT=MToolkit fallback: MToolkit (the Motif AWT toolkit) was removed from OpenJDK back in JDK 7, so on any JDK a user will actually be running the variable is inert. The wiki still carries the line as legacy text, and the record additionally inverts its wording: the wiki says 'for later versions', the record says 'on older JDKs'. Presenting dead advice as a step to try wastes the user's time on a real, fixable problem.
Symptom
A Java/Swing application opens as a plain gray box with no UI drawn at all, or its menus flash open and close immediately on click, or the window refuses to redraw when the tiling WM resizes it.
Cause
AWT has a hardcoded list of "non-reparenting" window managers. Hyprland (and most tiling WMs) are not on that list, so AWT picks the wrong reparenting behaviour and never paints. This is separate from the scaling problem: the window is blank, not merely too big.
Fix
Set the non-reparenting hint before launching. For a single app:
_JAVA_AWT_WM_NONREPARENTING=1 ghidraRun
Session-wide.
Hyprland 0.55+ / Omarchy 4.x (~/.config/hypr/envs.lua, or the bottom of ~/.config/hypr/hyprland.lua):
hl.env("_JAVA_AWT_WM_NONREPARENTING", "1")
Hyprland <=0.54 / Omarchy 3.x (~/.config/hypr/hyprland.conf):
env = _JAVA_AWT_WM_NONREPARENTING,1
Do NOT bother with AWT_TOOLKIT=MToolkit. The Arch wiki still lists it, but the Motif AWT toolkit was removed from OpenJDK in JDK 7. On any JDK you can actually install today the variable is silently ignored.
If the hint alone is not enough, impersonate a WM that IS on AWT's list, which is the other approach the Arch Java page documents:
sudo pacman -S --needed wmname
wmname LG3D
Run that once per session (before launching the Java app). It only affects XWayland clients.
If a JavaFX app freezes the whole session while debugging, add:
java -Dsun.awt.disablegrab=true -jar app.jar
Verify
The application window renders its actual UI instead of a gray rectangle, and menus stay open when clicked.