Java applications which use the XToolkit/XAWT backend may draw gray windows only. The XToolkit/XAWT backend breaks ICCCM-compliance in JDK 5 and 6 because it assumes a reparenting window manager.
There are a number of places where this is described:
- in the FAQ : GUI Java apps appear as a gray screen!
- in the wiki Problems with Java
- in the Man page
To sum up:
- it doesn't affect version Java 1.4.2 and before.
- it doesn't affect version Java 1.7 and hopefully after.
- the best workaround by far, is to set a name to the Window Manager, so it is recognise by Java as a non-reparenting Window Manager. A simple utility allow to set this name. Just add 'wmname LG3D' to your .xinitrc or simply run it.
- Here are other workarounds left here for reference:
- launch another X server, like Xephyr
- set the following environment variable (to use the older Motif back-end instead): AWT_TOOLKIT=MToolkit. But this won't work in the following cases :
- OpenJDK/IcedTea doesn't include the Motif toolkit.
- doesn't work for x86_64 Java, for whatever reason.
2 comments:
Bruno, you are a lifesaver! Thank you for posting this workaround on my Docunext blog:
http://www.informedcoding.com/blog/2009/07/awesome-wm-java-guis.html
The ia32 / MToolkit workaround was still a little buggy on my AMD64 system. Yours is working like a charm. Thanks again.
This tip is perfect Bruno! Once I compiled wmname and ran 'wmname LG3D' my windowed java application worked perfectly. My setup is amd64 ubuntu running the awesome window manager.
Post a Comment