Graphical Java programs : Assertion `c->xlib.lock’ failed”

21 11 2007

If you are running linux and you had problems with some graphical Java programs (e.g. jconsole), then you could be interested in the following patch. The bug is known, but does not seem to have been solved correctly yet even if Novell indicates it as resolved. Each time I update java under OpenSuse 10.3, I must apply this patch.

# S. Correia
# 2007 11 21
# A simple script to patch the java library in order
# to solve the problem with "Assertion 'c->xlib.lock' failed."
# see bug
for f in `find /usr/lib/jvm -name "$LIB_TO_PATCH"`
echo "Patching library $f"
sudo sed -i 's/XINERAMA/FAKEEXTN/g' "$f"



6 responses

28 11 2007

I updated the line: sed -i ’s/XINERAMA/FAKEEXTN/ig’ “$f”
I added /i in order to be case insensitive because there appears to be some “Xinerama” strings in some
But I am not sure it is correct: It seems that since then i have other problems with awt applications in which the windows do not resize correctly and the menus do not behave as they should…
So maybe the original replacement was better:
sed -i ’s/XINERAMA/FAKEEXTN/g’ “$f”

28 12 2007

Thanks for the patch. I was trying to run netbeans 6 on openSuse10.3 when I encountered this issue. I made a small change to the patch here in order to resolve

I changed the find -name /usr/lib/jvm to find -name /usr/jdk/latest

With change I was able to run netbeans.

30 12 2007

Thanks for the little script. Seems like the problem also occurs on Ubuntu…

11 02 2008

It seems that the last updates of java from Opensuse are now working better. I only get some warning now without the need to apply the patch.

But see also
if you have problems with openoffice and ubuntu.

11 03 2008

how can i rename name /usr/lib/jvm to find -name /usr/jdk/latest

11 03 2008

I am not sure to understand what you mean. Do you want to replace “/usr/lib/jvm” by “/usr/jdk/latest”?
If you are refering to the comment from linezfanatix, just copy my script and replace “/usr/lib/jvm” by “/usr/jdk/latest” (this is the path to the installation of your JVMs, you can replace it by other paths if you need).
What linezfanatix wanted to say is only to replace “/usr/lib/jvm” by “/usr/jdk/latest”. The command “find -name /usr/lib/jvm” is not correct.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: