25/08/2008

Blank Java windows with compiz

Java apps (e.g. my favourite BibTeX editor, JabRef) have a habit of coming up as persistently blank windows with compiz and several recent Java versions. According to this thread this is due to Java expecting your window manager to re-parent the window which compiz doesn't (I'm so not a WM expert...). The following workaround did OK for me. Override the Java VM's default AWT Toolkit, e. g. calling JabRef:
export AWT_TOOLKIT=MToolkit
java -jar JabRef-2.3.1.jar

If you use Java apps a lot, it might be a good idea to add the export statement to your ~/.bashrc - or write the two lines above in a shell script in /usr/bin or similar.

UPDATE (2010): My days of compiz are long past, but I didn't change my ~/.bashrc despite several new SuSE installations. Running Jabref 2.5 with Sun's Java 1.6.0_17 on SuSE 11.2 (KDE 4.4β) produced a segfault citing a problematic frame in libc.so.6. Unsetting the AWT_TOOLKIT variable solved it.

No comments: