Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am a heavy user of Java applications such as Matlab and Maple. Will the global menu support these very important packages?

If not, are there plans to do this?

share|improve this question
Offtopic but you should look at these (…) – Alaukik Jan 25 '11 at 14:45
up vote 1 down vote accepted

You can have global menu integration for any Java based application that implements a JMenubar by installing Jayatana:

  • Copy this script
  • Save it in your Desktop or Home directory .
  • Open a terminal, type cd ~/
  • Type again: bash path_to_the_newly_saved_script
  • Follow instructions (You need an internet connection).


    # ----------------------------------------------
    # Author:
    # Before executing this script make sure 
    # you're in your home directory `cd $HOME`
    # -------------------------------------NOTICE------------
    # This script installs Jayatana for your JDKs 
    # It supposes you already have set your JAVA_HOME in ~/.bashrc
    # You will be prompted to choose which JDK to set as Default 
    # (choose the corresponding index).
    # In case you already installed jayatana and want to re-install, 
    # please uninstall then install again.
    # ------------------------------------------------------
    # -------------------------------------LICENSE--------------------
    #Licensed under the GNU LGPL, Version 3.0 (the "License");
    # you may not use this file except in compliance with the License
    # ----------------------------------------------------------------
    #JDKPATH=`echo $JAVA_HOME | sed -e 's/bash://g' | sed -e 's/Is a directory//g'`
    #JDKPATH=eval "echo $JAVA_HOME"
    JDKPATH=`echo $JAVA_HOME | grep [^*]`
    USERHOME=`echo $HOME`
    # INSTALL 
    sudo apt-get -y install openjdk-7-jdk libunity-dev libxt-dev gcc make ant subversion 
    sudo update-java-alternatives -s java-1.7.0-openjdk-amd64 
    svn checkout $JAYATANADD 
    sudo ant install -buildfile $USERHOME/jayatana/build.xml -v
    sudo ant config -v 
    sudo update-alternatives --config java 
    sudo update-alternatives --config javac
    sudo ant install -Djava.home.7=/usr/lib/jvm/java-7-openjdk-amd64 -f $USERHOME/jayatana/build.xml -v -l $USERHOME/Desktop/jayatana-stall.log
    sudo ant config -Djava.home.7=$JDKPATH -f ~/jayatana/build.xml -v -l $USERHOME/Desktop/jayatana-stall.log
    sudo ant deinstall -buildfile $USERHOME/jayatana/build.xml -v
    sudo ant deconfig -buildfile $USERHOME/jayatana/build.xml -v
    sudo ant deconfig -Djava.home.7=$JDKPATH -f $USERHOME/jayatana/build.xml -v -l $USERHOME/Desktop/jayatana-stall.log
    # DELETE Jayatana Folder created by subversion checkout
    UNDIR() {
    read -p "Delete Jayatana Folder too? Enter ( y ) to delete or ( n ) otherwise : " choice
    if [ "$choice" = "y" ]; then mv $HOME/jayatana $HOME/.local/share/Trash/files/
    elif [ "$option" = "n" ]; then echo"Jayatana Folder is kept by $USER";
    echo "you can delete it later : ~/jayatana";
    else echo "Jayatana Folder is kept by $USER , you can delete it later : ~/jayatana";
    # COMMON
    COMMON() {
    echo "$JDKPATH : is your default JDK. Version: " 
    echo `java -version`
    eval COMMON;
    read -p "Enter ( i ) to install or ( u ) to uninstall : " option
    if [ "$option" = "i" ]; then eval INSTALLCOM
    elif [ "$option" = "u" ]; then eval UNINSTALLCOM;eval UNDIR;
    else echo "Aborted by $USER";
    exit 0;

You can see detailed information in this post: Ubuntu Global Menu Support for Java Applications

For ECLIPSE, this is different. The package ECLIPSE is blacklisted in the library because its integration with Global Menu is somehow broken (menus are sometimes dupmlicated and disordered). Same goes for EMACS23 (Dynamic menus do not appear when using global menu). So they're blacklisted, until developers provide a global fix.

share|improve this answer
Wow, this is amazing. Thanks! Any idea whether the Ubuntu developers are aware of this? – Ingo Jan 6 '13 at 11:13
Yeah. They are aware of it. – Hanynowsky Jan 9 '13 at 21:52

This is currently an open bug.

I recommend subscribing to it to follow its progress. (How to subscribe)

share|improve this answer
Great, subscribed to it. Shoud I make a comment about my problem or would it just annoy the developers? – Ingo Jan 25 '11 at 15:31
Click the "Affects me" near the top, this is the equivalent of leaving a comment that it's important to you without sending bug mail to hundreds of people. – Jorge Castro Jan 25 '11 at 15:33
Any news on this Jorge? – Ingo Jan 5 '12 at 16:44
@Ingo it's in the bug report. – Jorge Castro Jan 5 '12 at 16:46

The opened bug mentioned in this thread is about Eclipse, which doesn't use the default Java GUI toolkit (Swing) used by many Java applications (Eclipse uses SWT).

So, we probably are going to have no Unity integration for Java applications even if they solve that specific bug.

share|improve this answer
I have filed for Swing. – Jesse Glick Apr 18 '12 at 13:57

There is a program called java-swing-ayatana that supports this. I'm not sure if it works with every java application. But it now has a PPA install so it's pretty easy.

sudo add-apt-repository ppa:danjaredg/jayatana
sudo apt-get update
sudo apt-get install jayatana

You may need to restart your session after this.

share|improve this answer

Any command which can be run from the command line can be added to the menu.

Global menu items can be found in /usr/share/menu. You should be able to add new entries by editing an existing entry.

Personal entries can be be added by right clicking on the Applications item on the panel.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.