Java Swing Ayatana – Ubuntu Global Menu Support

Thanks to the new Project named Java Ayatana (Initiated by Jared Gonzales), Java Swing applications developers can now add support for Ubuntu Unity Global menu integration and Unity Launcher (Only one instance of Netbeans entry will be allowed in the Launcher and will persist despite logout or reboot).

All you have to do is import the Java Ayatana Library to your Java project CLASSPATH and call it in your Main JFrame object Class.

N.B: The property ‘Exec=netbeans‘ assumes that you are already able to run NetBeans inTerminal using the command : netbeans instead of the whole path to netbeans executable.Finally, drag the same file to your Unity Launcher, if not yet done.

Netbeans Integrtion with Ubuntu Unity Global Menu & Launcher

Netbeans Integrtion with Ubuntu Unity HUD

—————————————————

Today, you can set your default JRE (Java Runtime Environment) (Oracle JRE or OpenJDK JRE) to call Jayatana whenever the VM is run by a swing application.

You no more need to import the Jayatana library into your Swing project classpath. Now, execute your swing application in ubuntu and it’s automatically integrated with Global Menus.

What to do?

Depending on your JDK of choice, here are the appropriate steps to follow:

Semi-Automatic Installation

If you want to automate the Jayatana installation, you can use or download this script below as follows:– Copy/Paste the script content in a file and name it : install-jayatana.sh– Save the file in your Desktop folder.– go to Terminal and type: sh ~/Desktop/install-jayatana.sh– Follow instructions.– Later on, if you want to uninstall Jayatana, use the same script again.