OPINIONATED OMARCHY
TROUBLESHOOTING CORPUS
790
RECORDS
790
AUDITED
0
UNCHECKED
2388
SOURCES
LIVE
wayland-compat medium common DISPUTE

Bring oversized Java apps like Ghidra and Burp Suite back to normal size

omarchyarchendeavouroscachyosmanjarohyprlandwaylandxwayland
AUDITED Audited against its sources and confirmed accurate.

Symptom

Java GUI applications (Burp Suite, Ghidra, JADX-GUI, JD-GUI, JetBrains IDEs) open enormously zoomed in. Buttons and fonts are roughly double size and the window may be larger than the screen. Non-Java apps are fine.

Cause

Since Java 9, AWT/Swing reads GDK_SCALE to pick its UI scale. Under a Wayland compositor Java runs through XWayland and does not see the Wayland scale, so it applies GDK_SCALE on top of an already-correctly-sized X screen. AWT/Swing only honours integer scales, so GDK_SCALE=2 doubles everything.

Fix

Override the scale for Java processes only. Per-launch:


java -Dsun.java2d.uiScale=1 -jar burpsuite.jar

Or via environment, which works for wrapper scripts you cannot edit:


JAVA_TOOL_OPTIONS=-Dsun.java2d.uiScale=1 GDK_SCALE=1 ghidraRun

Make it permanent for a desktop entry. Copy it to your user dir first so package updates do not clobber it:


cp /usr/share/applications/burpsuite.desktop ~/.local/share/applications/

then edit the Exec line:


Exec=env GDK_SCALE=1 JAVA_TOOL_OPTIONS=-Dsun.java2d.uiScale=1 /usr/bin/burpsuite

JavaFX apps use a different property and do support fractions:


java -Dglass.gtk.uiScale=1.5 -jar app.jar

For JetBrains IDEs, add to Help > Edit Custom VM Options:


-Dsun.java2d.uiScale.enabled=true
-Dsun.java2d.uiScale=1

Verify

Relaunch the Java app. The toolbar icons and menu font are the same physical size as in your other apps, and the window fits on screen.

Sources

java-swing-apps-oversized