Java Swing and Compiz

posted by Jake on

On Ubuntu 9.04, Jaunty, Compiz comes running out of the box on the mid-level preset for desktop effects. These effects and generally beautiful and pleasing, but a couple of the apps that I use are Java-based and have some compatibility issues with Compiz. At least for my apps, I've found a way around this issue.

The symptom you're looking for is that the Java-based app window has a problem painting. For me, this meant that it was totally blank. I have had this problem with Oracle's SQLDeveloper 1.5.x and IntelliJ 8.x.

First, close the apps in question.

Edit your .bashrc file.

emacs ~/.bashrc

Add this line:

export AWT_TOOLKIT=MToolkit

Reload your bashrc:

. .bashrc

Try starting your apps again. For me, testing this on SQLDeveloper 1.5.4, the fix worked well. IntelliJ 8.1.3 on Ubuntu 9.04 works well regardless.

Update

Wow, in this case the side effect of the medicine was worse than the initial symptom. In the case of IntelliJ 8.1.3, this "fix" is causing my keyboard to be non-responsive in the main IDE window after a few minutes. I am unsure of the specific reason, but I have observed clearly the cause and effect which really started to make me frustrated!

So, perhaps it would be wise to export this AWT_TOOLKIT parameter in a less global place, perhaps just on the .sh file of the app that you're experiencing trouble with, e.g. sqldeveloper.sh.

Leave a comment

blog comments powered by Disqus