Beryl + Java Swing does not draw

Bug #87665 reported by Mackenzie Morgan
This bug report is a duplicate of:  Bug #118983: compiz & java windows always grey. Edit Remove
12
Affects Status Importance Assigned to Milestone
Beryl
New
Undecided
Unassigned
Sun Java
New
Undecided
Unassigned
sun-java6 (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: ia32-sun-java6-bin

If you use Beryl instead of Metacity, Swing apps do not draw. They are solid white. It was reported to Sun with Compiz and they claim it's fixed, but it's not. When running a Java app from CLI, the fix is to have the line:

export AWT_Toolkit=MToolkit

in your .bashrc. I don't know what to do if you're not running from the CLI (haven't tried as I have no apps that run any other way). The problem is an upstream Sun bug which Sun claims was fixed. Maybe their fix didn't make it into Ubuntu, but I have the problem with Java 5 and Java 6.

Revision history for this message
Mackenzie Morgan (maco.m) wrote :

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6429775
^That's the Sun bug. It wouldn't let me put it in the "upstream" URL

Revision history for this message
Allcolor-g (allcolor) wrote :

Here is a little article in french which explains how to patch a java6 jdk to make it work with beryl.

http://artisan.karma-lab.net/node/1124

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Another way to patch is following what is written on beryl wiki... http://wiki.beryl-project.org/wiki/Java

Forcing beryl to show itself as Compiz (editing its code) is another working workaround...
Just edit the file running this on main beryl-core dir:
 perl -i -p -e 's/#define MYNAME "beryl"/#define MYNAME "compiz"/' ./src/screen.c

Bye

Revision history for this message
Mackenzie Morgan (maco.m) wrote : Re: [Bug 87665] Re: Beryl + Java Swing does not draw

The instructions on the Beryl Wiki don't seem to work. Maybe it's something to do with how different distros have a different arrangement for the file system, but
root@maco-unstable:~# cp /usr/java/jdk1.6.0/jre/lib/rt.jar /usr/java/jdk1.6.0/jre/lib/rt.jar.orig
cp: cannot stat `/usr/java/jdk1.6.0/jre/lib/rt.jar': No such file or directory

when trying to do the 3rd step.

Mackenzie Morgan
Linux User # 432169
Hey, type this in the terminal! It's really fun!
apt-get moo
then try
aptitude moo
and
aptitude -v moo
just keep adding v's to that and watch it change

----- Original Message -----
From: Treviño <email address hidden>
Date: Monday, March 26, 2007 12:14 pm
Subject: [Bug 87665] Re: Beryl + Java Swing does not draw
To: <email address hidden>

> Another way to patch is following what is written on beryl wiki...
>
>
> Forcing beryl to show itself as Compiz (editing its code) is another
> working workaround...
> Just edit the file running this on main beryl-core dir:
> perl -i -p -e 's/#define MYNAME "beryl"/#define MYNAME "compiz"/' ./src/screen.c
>
> Bye
>
> ** Also affects: beryl (upstream)
> Importance: Undecided
> Status: Unconfirmed
>
> --
> Beryl + Java Swing does not draw
>

Revision history for this message
Ryba (sepatel) wrote :

Without having to recompile beryl, how can I get java 6 swing applications to work.

jconsole out of the box is a big blank. However if you switch to metacity and *then* switch to beryl it works fine.

I also to test something wrote a very simple application which is nothing more then a jframe, jmenubar, and 1 jmenuitem which exists the application.

With beryl on, the jframe starts up with nothing visibile inside of it. If I switch to metacity it works. If while it is *already* running, I switch back to beryl, it works until I restart the java program.

Obviously it seems to me that beryl itself is not broken but that java is detecting (or not detecting) something incorrectly.

Revision history for this message
Allcolor-g (allcolor) wrote :

Ryba...

Did you read comments upper ?

Follows these URL to understand the problem:

http://wiki.beryl-project.org/wiki/Java

http://artisan.karma-lab.net/node/1124 (in french)

Revision history for this message
Matthias Klose (doko) wrote :

we are not allowed to distribute a modified jre/sdk.

Changed in sun-java6:
status: Unconfirmed → Confirmed
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Mh, ok... So what about packaging for Ubuntu a sun Java JDK/JRE version above 1.6.0_01-ea-b01 wich has these fixes just for compiz: http://download.java.net/jdk6/6u1/promoted/b01/changes/jdk6u1-b01.html; then you simply have to apply the patch I posted to beryl and all will be fixed...

So my proposed todo list is:
 - Package newer Java (better whould be 1.6.0_02-ea-b01 released few days ago and with many gtk-swing fixes: http://tinyurl.com/2kc7de
- Patch beryl (compiz is not needed) to make itself show as compiz as I posted above (just one line to edit).

All this is safe, I'm doing that on my laptop for months and it's all working....!

PS: those newer versions of java are btw available using my make-jpkg-mustang tool (look at ubuntuforums)

Revision history for this message
Matthias Klose (doko) wrote :

Treviño schrieb:
> Mh, ok... So what about packaging for Ubuntu a sun Java JDK/JRE version
> above 1.6.0_01-ea-b01 wich has these fixes just for compiz:
> http://download.java.net/jdk6/6u1/promoted/b01/changes/jdk6u1-b01.html;
> then you simply have to apply the patch I posted to beryl and all will
> be fixed...

this version is not yet released un der the DJL, the license needed for
redistribution

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

No way to contact sun to get that? :/

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

No way to contact sun to get that? :/

Otherwise I think you should add something to feisty to make it add AWT_Toolkit=MToolkit somewhere...

A way I use in my script is a good workaround I think... Pratically in /usr/lib/jvm/java-1.6.0-sun/jre/bin I move the "java" binary file to "java-bin" while I've put a "fake" java file containing a bash script that applies some default settings to java itself (launching java-bin).
I've tested my solution and works in all situations I found and also I didn't receive any problem/bad-report about the sun's java *.deb files generated using my script (and they included this mentioned "java" script file).

I think that this could be considered a "solution" (or good "workaround", if you prefer) for this and other problems... I'll post this script here soon.

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Here you are the script file I was talking about: https://bugs.beta.launchpad.net/ubuntu/+source/sun-java6/+bug/99435

Revision history for this message
eljefe6 (jesse-anderson) wrote :

You might want to check the license restrictions again. You were looking at the license of an "ea" or early access release. The full release is out now.

Revision history for this message
Matthias Klose (doko) wrote :

eljefe6 schrieb:
> You might want to check the license restrictions again. You were
> looking at the license of an "ea" or early access release. The full
> release is out now.

you're wrong; the packages are not yet released at https://jdk-distros.dev.java.net/

Revision history for this message
StratosJL (stratosjl) wrote :

I confirm that the final release 7.04 still has the bug #87665 in sun-java6 (Ubuntu). I tried to run netbeans 5.5 and the window was blank. Then I chose "metacity" instead of beryl and it worked.

I tried the same procedure with the same results by starting Sun Java 6 Console from the system tools menu. It came up blank. Was fixed by turning to metacity

Revision history for this message
Guillermo Gutiérrez (capitanterrex) wrote :

Running the script beryl.jdk6.fix.sh readable at http://wiki.beryl-project.org/wiki/Java solved the problem for me in ubuntu feisty + feisty's beryl :D
Please, could you consider the patch inside the script for inclusion as feisty-updates?
It seems that Sun fixed the issue with compiz, but fixing it for beryl is assigned for sun-java7 as you can read in Sun's bug tracking system.
Cheers

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

As known, there won't be anymore beryl in the world and as mentioned ubuntu can't distribute patched java binaries, so this bug will survive on feisty... The fixes I've mentioned above are working fine here...

Revision history for this message
StratosJL (stratosjl) wrote :

From what I see, all of us here are using fixed versions, either by renaming beryl to compiz or by patching the java binary, or by running a script.

Beryl won't exist by the time java7 comes out, but this is not an excuse, because neither will compiz. They are supposed to merge and adopt a new name or something. Can there be something made available, so that the rest of the people can be saved the trouble in the meantime, without breaking any distribution license?

Revision history for this message
Thomas Hotz (thotz-deactivatedaccount) wrote :

Netbeans + Desktop Effects enabled does NOT work for me on Ubuntu Feisty. When I disable desktop-effects everything works fine.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.