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?
This is currently an open bug.
I recommend subscribing to it to follow its progress. (How to subscribe)
You can have global menu integration for any Java based application that implements a JMenubar by installing Jayatana:
cd ~/
bash path_to_the_newly_saved_script
Follow instructions (You need an internet connection).
#!/bin/bash
# ----------------------------------------------
# Author: [email protected]
# Before executing this script make sure
# you're in your home directory `cd $HOME`
#--------------------------------------------------
# -------------------------------------NOTICE------------
# APPLICABLE ONLY IN UBUNTU UNITY
# 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`
JAYATANADD="http://java-swing-ayatana.googlecode.com/svn/tags/1.2.4/jayatana"
# INSTALL
INSTALLCOM () {
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
}
# UNINSTALL
UNINSTALLCOM (){
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";
fi
}
# 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";
fi
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 libappmenu.so 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.
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.
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.
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.