Missing Matlab menu’s with ubuntu

After installing matlab 7.4.0 on ubuntu hardy (8.04), I got the following stack trace on the gnome output console;

patrickd@battlestar:~$ Locking assertion failure. Backtrace:
#0 /usr/lib/libxcb-xlib.so.0 [0xb5ac0767]
#1 /usr/lib/libxcb-xlib.so.0(xcb_xlib_unlock+0x31) [0xb5ac08b1]
#2 /usr/lib/libX11.so.6(_XReply+0xfd) [0xb5e2c1bd]
#3 /opt/matlab/sys/java/jre/glnx86/jre1.5.0/lib/i386/xawt/libmawt.so [0xa090826a]
#4 /opt/matlab/sys/java/jre/glnx86/jre1.5.0/lib/i386/xawt/libmawt.so [0xa08ee352]
#5 /opt/matlab/sys/java/jre/glnx86/jre1.5.0/lib/i386/xawt/libmawt.so [0xa08ee599]
#6 /opt/matlab/sys/java/jre/glnx86/jre1.5.0/lib/i386/xawt/libmawt.so(Java_sun_awt_X11GraphicsEnvironment_initDisplay+0x24) [0xa08ee7a4]
#7 [0xadcbdb8b]
#8 [0xadcb7a7b]
#9 [0xadcb7a7b]
#10 [0xadcb5157]
#11 /opt/matlab/sys/java/jre/glnx86/jre1.5.0/lib/i386/client/libjvm.so [0xb294f8ec]
#12 /opt/matlab/sys/java/jre/glnx86/jre1.5.0/lib/i386/client/libjvm.so [0xb2a3e378]
#13 /opt/matlab/sys/java/jre/glnx86/jre1.5.0/lib/i386/client/libjvm.so [0xb294f71f]
#14 /opt/matlab/sys/java/jre/glnx86/jre1.5.0/lib/i386/client/libjvm.so(JVM_DoPrivileged+0x2db) [0xb29a7ebb]
#15 /opt/matlab/sys/java/jre/glnx86/jre1.5.0/lib/i386/libjava.so(Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedAction_2+0x3d) [0xb2f422cd]
#16 [0xadcbd43b]
#17 [0xadcb79a4]
#18 [0xadcb5157]
#19 /opt/matlab/sys/java/jre/glnx86/jre1.5.0/lib/i386/client/libjvm.so [0xb294f8ec]
Locking assertion failure. Backtrace:
#0 /usr/lib/libxcb-xlib.so.0 [0xb5ac0767]
#1 /usr/lib/libxcb-xlib.so.0(xcb_xlib_lock+0x2e) [0xb5ac081e]
#2 /usr/lib/libX11.so.6 [0xb5e2b518]
#3 /usr/lib/libX11.so.6(XGetVisualInfo+0x26) [0xb5e220a6]
#4 /opt/matlab/sys/java/jre/glnx86/jre1.5.0/lib/i386/xawt/libmawt.so [0xa08ed227]
#5 /opt/matlab/sys/java/jre/glnx86/jre1.5.0/lib/i386/xawt/libmawt.so [0xa08ed4b8]
#6 /opt/matlab/sys/java/jre/glnx86/jre1.5.0/lib/i386/xawt/libmawt.so [0xa08ee6e0]
#7 /opt/matlab/sys/java/jre/glnx86/jre1.5.0/lib/i386/xawt/libmawt.so(Java_sun_awt_X11GraphicsEnvironment_initDisplay+0x24) [0xa08ee7a4]
#8 [0xadcbdb8b]
#9 [0xadcb7a7b]
#10 [0xadcb7a7b]
#11 [0xadcb5157]
#12 /opt/matlab/sys/java/jre/glnx86/jre1.5.0/lib/i386/client/libjvm.so [0xb294f8ec]
#13 /opt/matlab/sys/java/jre/glnx86/jre1.5.0/lib/i386/client/libjvm.so [0xb2a3e378]
#14 /opt/matlab/sys/java/jre/glnx86/jre1.5.0/lib/i386/client/libjvm.so [0xb294f71f]
#15 /opt/matlab/sys/java/jre/glnx86/jre1.5.0/lib/i386/client/libjvm.so(JVM_DoPrivileged+0x2db) [0xb29a7ebb]
#16 /opt/matlab/sys/java/jre/glnx86/jre1.5.0/lib/i386/libjava.so(Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedAction_2+0x3d) [0xb2f422cd]
#17 [0xadcbd43b]
#18 [0xadcb79a4]
#19 [0xadcb5157]

Which appears to be causing the standard menus in matlab not to display, after trying various solutions found around the great wide inter web, the one that finally worked for me was to edit the matlab startup script at <$matlab_home>/bin/matlab and insert the following at the top of the file;

export AWT_TOOLKIT=MToolkit

After editing the matlab startup script it now looks like;

patrickd@battlestar:~$ head /opt/matlab/bin/matlab
export AWT_TOOLKIT=MToolkit
# Name:
# matlab script file for invoking MATLAB
# Usage:
# matlab [-h|-help] | [-n | -e]

Note: This doesn’t actually appear to stop the error message above from appearing in the terminal window, it does however allow the menus to display which for now is all I need to fix. If I later discover that the error message is causing something else not to work in Matlab then I ‘ll update this post.


5 Responses to Missing Matlab menu’s with ubuntu

  1. Dermot - ISEL says:

    So I upgraded to Ubuntu 8.04 and reinstalled Matlab and guess what the menu was missing. So I google for ‘matlab ubuntu no menu’ and up comes Paddy to answer. It’s just like your back in the lab!

  2. Paddy says:

    no problem mate, happy to help 🙂

  3. Sina says:

    That’s great, Thank you for posting it, It really helped me. I was close to uninstall Ubuntu but with your guide everything is OK now.

  4. Dear Paddy,

    Many thanks to you and to google. I would like to know how did you find this solution. Are you a matlab developer ? /Linux expert ?


    • Paddy says:

      Hi Suvra,

      Thanks for the helpful comments, I use Matlab in my day to day work but I don’t develop the application per se. I think I pieced together the “fix” from a number of comments made by others in serveral newsgroups and mailing lists about problems which had been reported with Java menu’s in their applications. I’m also only a normal linux user although I have been using it for almost 10 years now.


Leave a Reply

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

WordPress.com Logo

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s

%d bloggers like this: