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

Write tutorials for Linux Mint here
More tutorials on https://github.com/orgs/linuxmint/discu ... /tutorials and (archive) on https://community.linuxmint.com/tutorial
Forum rules
Don't add support questions to tutorials; start your own topic in the appropriate sub-forum instead. Before you post read forum rules
Post Reply
scorp123
Level 8
Level 8
Posts: 2272
Joined: Sat Dec 02, 2006 4:19 pm
Location: Switzerland

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

Post by scorp123 »

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/viewtopi ... =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
User avatar
hairy_Palms
Level 4
Level 4
Posts: 292
Joined: Mon Nov 27, 2006 10:46 am

Post by hairy_Palms »

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
scorp123
Level 8
Level 8
Posts: 2272
Joined: Sat Dec 02, 2006 4:19 pm
Location: Switzerland

Post by scorp123 »

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

Post by hairy_Palms »

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

Re:

Post by jiterz1 »

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.
Post Reply

Return to “Tutorials”