Java "swing" (= GUI) programs + Beryl = Problems!

Write tutorials here
There are more tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Please don't add support questions to tutorials,start your own thread in the appropriate sub-forum instead. Before you post please read this
User avatar
scorp123
Level 8
Level 8
Posts: 2277
Joined: Sat Dec 02, 2006 4:19 pm
Location: Switzerland

Java "swing" (= GUI) programs + Beryl = Problems!

Postby scorp123 » Fri Feb 09, 2007 7:28 pm

Hello out there,

in the hope that this might be useful to others I am posting this here.

If you use the newer FrostWire and/or LimeWire versions, chances are that you will have troubles to get them to work. There are many other Java-based applications too --mainly those written with the "swing" and/or "AWT" GUI toolkits for Java-- too that have problems with Beryl / Compiz / AIGLX and/or XGL.

The most common problem is that the program window remains grey, ie. the program only displays a grey empty area, there are no controls, no program elements or whatsoever visibile. This is a bug and a series of currently existing incompatibilities between Java, some libraries, applications such as FrostWire and LimeWire and projects such as Beryl and Compiz. According to some talk I have seen in various message boards installing the new Java 6 SDK from SUN Microsystems will resolve most of those issues, but installing Java 6 is not for the faint of heart ... and I can't cover that here, but if you go to the Ubuntu Forums and Google around you will find good instructions on how to do this.

So aside from installing Java 6, what can you do to fix your Java apps? And still use Beryl / Compiz? Not using Beryl fixes those issues too ... But I for my part insist on using my eye-candy :lol:

In most --but not all!!-- cases you can solve the "Java windows remains grey" problem by following the instructions here:
http://www.linuxmint.com/forum/viewtopic.php?p=2145#2145

Unfortunately setting export AWT_TOOLKIT=MToolkit does not always help. e.g. in my case the newest versions of LimeWire will crash when I set this option -- and when I don't set it I get an empty window. Bummer. And I insist on using Beryl :lol:

After some long searching I found a workaround that might also work with other programs that have this problem:

You can launch a second X server ("X" is the graphical interface on UNIX-like operating systems; check Wikipedia!) and then have your "problematic" application run inside that second X server.

To achieve that you could use e.g. VNC (please Google around; there are good instructions for VNC everywhere!) but this would mean that your application won't be running on your current desktop, instead it will be running on a virtual desktop that you first need to connect to. This is good if you e.g. want to control FrostWire / LimeWire remotely, but maybe it's also overkill if you just want to have it in your current session.

To have it running in your current session I'd suggest to follow this hint I picked up on another message board: use Xnest.

Xnest should already be installed, it's pretty much standard these days and should be part of the X.org packages.

So the procedure is this: We launch Xnest as a window, we define a new $DISPLAY (a system variable that defines on which (virtual) screen we want the next program that will start displayed on!) and then tell LimeWire (or any other problematic app) to show up there, inside the new X server window, outside of Beryl's influence:

Code: Select all

#! /bin/bash

# launch Xnest and export the $DISPLAY
Xnest -ac :1 & export DISPLAY=:1

# Put the name of your problematic app here
# end line with "&" (task gets launched in the background)

limewire &


Hope that this might be useful to anyone else one day ...


Regards,
scorp123

friedtofu
Level 1
Level 1
Posts: 48
Joined: Wed Nov 22, 2006 9:36 pm

Postby friedtofu » Sat Feb 10, 2007 1:23 am

awesome. its nice to know there are ways to fix this problem... cuz i remember using beryl and although it had flashy graphics i guess i'll just stay with the murrine themes :)

User avatar
hairy_Palms
Level 4
Level 4
Posts: 292
Joined: Mon Nov 27, 2006 10:46 am

Postby hairy_Palms » Tue Feb 13, 2007 9:33 am

on the other hand installing java 6 isnt very hard :)

donwload the setup file

http://java.sun.com/javase/downloads/index.jsp select the jre

copy it to /usr/lib/jvm

then run it with ./filename

then change the symlink "java-1.5.0-sun" to point to the new 1.6 folder

User avatar
scorp123
Level 8
Level 8
Posts: 2277
Joined: Sat Dec 02, 2006 4:19 pm
Location: Switzerland

Postby scorp123 » Tue Feb 13, 2007 9:09 pm

hairy_Palms wrote:then change the symlink "java-1.5.0-sun" to point to the new 1.6 folder
Did you try if programs such as Azureus and Frostwire will still work after that? :wink: I did. And they stopped working after this, for whatever reason. Maybe it's just my setup. :roll: But can you please try if well-known Java apps such as Azureus et al will still work? :? I'd really appreciate that. :D

User avatar
hairy_Palms
Level 4
Level 4
Posts: 292
Joined: Mon Nov 27, 2006 10:46 am

Postby hairy_Palms » Fri Feb 16, 2007 6:51 am

azureus stilll works im using it now, i dunno about frostwire, but jrisk still works, and thats a swt app.

[EDIT] oh and eclipse still works too.

jiterz1
Level 1
Level 1
Posts: 1
Joined: Sun Jul 25, 2010 3:30 am

Re:

Postby jiterz1 » Sun Jul 25, 2010 3:35 am

friedtofu wrote:awesome. its nice to know there are ways to fix this problem... cuz i remember using beryl and although it had flashy graphics i guess i'll just stay with the murrine themes :)


Were you trying to run a Java-based app that's listed in your menu? If so, it won't work. You have to run the program from the terminal. I didn't test with Java 5 (1.5) though, so you could be right. It definitely works with Java 6.


Return to “Tutorials”

Who is online

Users browsing this forum: WharfRat and 5 guests