Tuesday, October 6, 2015

Ubuntu 15.10 And 15.04 Update Disables JAyatana (Global Menu And HUD For Java Swing Applications) By Default

JAyatana

JAyatana is a project that integrates Java Swing applications (such as NetBeans IDE, IntelliJ IDEA, Android Studio, jDownloader and so on) with Ubuntu's global menu and HUD.

Starting with Ubuntu 15.04, JAyatana was installed by default and it was configured to allow all Java Swing applications to use Ubuntu's global menu and HUD. This was changed yesterday when JAyatana was updated to no longer export the JAVA_TOOL_OPTION session file, meaning that Ubuntu no longer supports HUD or global menu for Java Swing applications by default.

This change affects both Ubuntu 15.10 and 15.04 (though for Ubuntu 15.04, this update is still in the proposed repository).

The reason behind the change is that by enabling JAyatana globally, each time you run a Java application, this would be displayed in the output:
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar
And this breaks some programs that are running "java -version" and grep the output.

If this doesn't affect the applications you're using, you can re-enable JAyatana globally, by creating a file called "jayatana.conf" under /usr/share/upstart/sessions/ and paste this in the file:
description "Java Ayatana"

start on starting dbus

script
initctl set-env --global JAVA_TOOL_OPTIONS="-javaagent:/usr/share/java/jayatanaag.jar $JAVA_TOOL_OPTIONS"
end script
Then save the file, restart the session and Unity's global menu and HUD should work again for Java Swing applications.

You can also enable it on a per-program basis, by adding the following line in the program start script, etc.:
JAVA_TOOL_OPTIONS="-javaagent:/usr/share/java/jayatanaag.jar $JAVA_TOOL_OPTIONS"

No comments:

Post a Comment