Posted on March 27, 2015

Xmonad and Java

The bad news is that, left to its own devices, these two will not play well together and Java desktop applications will just look awful.

The good new is that it’s prety easy to fix it. I needed two things:

On my .zshrc:

export _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel -Dswing.crossplatformlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel'
export _JAVA_AWT_WM_NONREPARENTING=1

and then on my xmonad.hs:

import XMonad.Hooks.SetWMName
(...)
xmonad $ defaultConfig {
startupHook = setWMName "LG3D",
(...)
}

:-)