[Ubuntu] No global menu with Jayatana

Answered

I'm running IntelliJ IDEA 2016.3.3 on Ubuntu 16.04.

I'm trying to get IDEA's menu bar integrated with Unity's global menu, with little success. Here's what I've checked so far:

  • Jayatana is installed, and I've added "-javaagent:/usr/share/java/jayatanaag.jar" to the beginning of bin/idea64.vmoptions.
  • I have tried uninstalling and reinstalling Jayatana, to no avail.
  • When I run a demo app with menus using
    $IDEA_INSTALLATION/jre/jre/bin/java -javaagent:/usr/share/java/jayatanaag.jar -jar demo.jar
    it works just fine; the menus are integrated into Unity as expected.

Any ideas on what to try next?

1
28 comments

>I've added "-javaagent:/usr/share/java/jayatanaag.jar" to the beginning of bin/idea64.vmoptions.

It should work: https://youtrack.jetbrains.com/issue/IDEA-152207 Did you use Help | Edit Custom VM options action to modify the .vmoptions file?

Please also check that you have linux.native.menu=true property set (use Help | Edit Custom Properties action).

2

I had not added the linux.native.menu=true property set. I have now set both the VM Option and the Property, using the actions from the Help menu.

Now that I've added these, I'm finding that Unity menu integration works just fine if I start IDEA from the command line, but doesn't work if I use the launcher entry that IDEA created when I first started it. Can you think of any reason this might be?

The launcher entry reads:

I had not added the linux.native.menu=true property set.

I'm finding that Unity menu integration works just fine if I start IDEA from the command line, but doesn't work if I use the launcher entry that IDEA created when I first started it. Can you think of any reason this might be?

[Desktop Entry]
Version=1.0
Type=Application
Name=IntelliJ IDEA Community Edition
Icon=/opt/idea-IC-163.10154.41/bin/idea.png
Exec="/opt/idea-IC-163.10154.41/bin/idea.sh" %f
Comment=The Drive to Develop
Categories=Development;IDE;
Terminal=false
StartupWMClass=jetbrains-idea-ce

0

Did you try to lock IDEA icon in dock area? It also should work just fine.

0

I have locked the icon generated by Tools -> Generate Desktop Entry to my launcher.

Even so, Unity menu integration only works when I start IDEA from the command line. When I start IDEA using the launcher icon, there is no Unity menu integration.

0

Just checked 2016.3.4 with “-javaagent:/usr/share/java/jayatanaag.jar” line added to IDEA custom VM options (Help->IDEA custom VM Options) The integration works for the launcher entry

2

Just upgraded to 2016.3.4 and recreated the launcher icon from Tools -> Generate Desktop Entry. Not sure which of these actions fixed the issue, but Unity menu integration now works from the launcher entry!

Thanks for all your help!

0

I am using 2017.1.1 and can't get ubuntu global menu working.

0

Please share your .vmoptions.

0

My .vmoptions

-Xss2m
-Xms256m
-Xmx2000m
-XX:NewSize=128m
-XX:MaxNewSize=128m
-XX:ReservedCodeCacheSize=240m
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
-Dawt.useSystemAAFontSettings=lcd
-Dsun.java2d.renderer=sun.java2d.marlin.MarlinRenderingEngine
-javaagent:/usr/share/java/jayatanaag.jar

0

Do you have `/usr/share/java/jayatanaag.jar` file?

0

Yes, I have it.

0

@Jvalencia Please mention that you are running Ubuntu 17.04, there was a change in it that's causing the global menu not to work, on 16.XX the global menu works for all versions of the IDE (I have tried it with all recent versions of WebStorm).

0

Yes I am using Ubuntu 17.04, sorry I forgot to mention.

0

Opera has same issue, this fixes i for me:

 

 

cat >> ~/.profile <<GLOBALMENUFUX
# use Unity instead of Unity:Unity7
XDG_CURRENT_DESKTOP=Unity
export XDG_CURRENT_DESKTOP
GLOBALMENUFUX

0

Alexey Ushakov your solution work fine to me. Thank you. 

0

This is the error I get, after editing idea64.vmoptions and adding linux.native.menu=true in Custom properties.From this, the global menu is just cosmetically available but the menu doesn't provide any action after launching from command line.I think this error log can be of some help.

env XDG_CURRENT_DESKTOP=Unity /mnt/Data/Downloads/idea-IU-172.3968.16/bin/idea.sh 
Error parsing gtk-icon-sizes string: ''

(java:7024): LIBDBUSMENU-GLIB-WARNING **: Unable to register object on bus: An object is already exported for the interface com.canonical.dbusmenu at /com/canonical/menu/5000042
0

Hello @Imearifkhan

Did you add "-javaagent:/usr/share/java/jayatanaag.jar" in your custom properties? My Custom Properties have this configuration:

 

# custom WebStorm properties

linux.native.menu=true
-javaagent:/usr/share/java/jayatanaag.jar



It works for me. Ubuntu 16.04 LTS.
0

Yes, It doesn't work !

0

Our global menu integration based on jayatana library that unfortunately does not work with other desktops. We're going to provide more general solution in the future.

1

It's working in other desktops, like on gnome-shell for example, just the problem is that what jayatana is exported are pure checkboxes. This occurs from the non Unity desktops. Please see the issue in gnome shell:

https://github.com/lestcape/Gnome-Global-AppMenu/issues/93

And also see the same issue in Mate, xfce and more desktops:

https://github.com/rilian-la-te/vala-panel-appmenu/issues/137

The solution is probably, don't check for Unity only and instead, just check for the presence of jayatana.

Thanks anyway.

0
Avatar
Permanently deleted user

I'm using phpstorm installed from a snap. I have tweaked both vmoptions and properties and it doesn't work straight away.

However. If I run phpstorm from the command line like so:

env XDG_CURRENT_DESKTOP=Unity phpstorm

Then it works. Is there perhaps some check for this environment variable within PhpStorm itself? The default value for unity is now Unity:Unity7:ubuntu

I can't just change this value globally on my profile as it has knock on effects elsewhere, and static .desktop files are problematic when using snaps.

 

0

>I can't just change this value globally on my profile as it has knock on effects elsewhere, and static .desktop files are problematic when using snaps.

If you can not modify your profile environment try adding the environment variable in IDE .sh script.

0

Add "export JAYATANA_FORCE=true" to .profile file in your home directory. It's working. But search/replace inputs not working. Any idea?

0

Hello,

Please check the issue with IDEA 2018.3 EAP: https://www.jetbrains.com/idea/nextversion/

0

Latest EAP build working like expected.  But I need to wait final release. too many exception occurring.

0

To enable global menu integration in the latest EAP (183.3283.2) you need start IDE with key: linux.native.menu=true

0

Please sign in to leave a comment.