Comment 34 for bug 118983

Revision history for this message
In , Mario (mario-redhat-bugs) wrote :

Description of problem:

This is a known bug in Sun Java, I think we can do very little, I'm just posting
it here with a small workaround so that other people can find it easily and run
java programs until a fix is released from Sun.

The problem is that Swing applications with Sun Java do not work with Compiz and
Desktop effects enabled.

On the net there are a couple of workaround available, but I have found only one
works with fedora core 6.

One suggest to use MToolkit instead of the XToolKit:

export AWT_TOOLKIT=MToolkit

But this requires a library I was not able to find in fedora core 6 (it was in
the x11-deprecated-libs, but now this package seems to be removed).

The one that works with fedora is to install Xephyr and run java programs inside
Xephir, with metacity or another window manager that is not compiz, like the
following snippet shows:

--- cut ---
#! /bin/bash
# run_java.sh
Xephyr :2 -ac -screen 1430x850 &
metacity --display :2 &
export DISPLAY=:2
$1 &
--- cut ---

Just Create a file named run_java.sh with this content, Then just run
./run_java.sh netbeans or ./run_java.sh limewire and you will get a java program
into a Xephyr session, just change -screen values to suite your needs.

While this is a less than optimal solution, it works.

The last workaround is to disable compiz and desktop effects and use metacity
but it is really difficult to come back to the old desktop after you have tried
compiz :)

Version-Release number of selected component (if applicable):

Sun Java, at least from version 1.5.0_05 to 1.5.0_09 and 1.6.0 beta 2; IBM Java
1.5.0 update 3. Other JDK may have the same issues.

How reproducible:

Always, with compiz, some Swing based applications seem to work, but they froze
as soon as the user tries to resize the window.

Steps to Reproduce:
1. enable compiz
2. run a swing application

Actual results:
The application shows a grey windows, froze or does not resize (eventually
stopping to work)

Expected results:
Applications should start and work normally

Additional info:
GCJ seems to work, GNU classpath with Cacao also works. This is a bug in Sun
Java. SWT application are not affected. I have not tested AWT but it seems to
work, too (this is what I've read on the net, at least).

This is a bug enty in Sun Bugzilla that can be tracked:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6429775