ChatGPT解决这个技术问题 Extra ChatGPT

Eclipse menus don't show up after upgrading to Ubuntu 13.10

After upgrading to Ubuntu 13.10, when I click on any menus in Eclipse (Help, Window, Run) they don’t show up. Only menu stubs and selection are visible.

https://i.stack.imgur.com/0sOOd.png

I tried installing fresh 4.3 and the same thing is happening. Is anyone else experiencing this behavior?

what version of java do you have ?
@CPU100 Currently 1.7, but just tried with 1.6 - same deal. Someone suggested on Eclipse IRC to go through proxy: UBUNTU_MENUPROXY= /path/to/eclipse/eclipse, it works by putting menus inside Eclipse sheel, but it's a workaround.
sheel = shell. Sorry!
Just want to make clear that there is a <space> after UBUNTU_MENUPROXY= and before the path to eclipse... So you are unsetting the Env variable just for this command. Initially I interpreted this as setting UBUNTU_MENUPROXY to the path... which didn't work.

C
Community

The same question has been answered on askubuntu:

Eclipse menus are cut off or don't show

I might have found a possible solution for your problem. I have experienced the same issue as you have described, Ubuntu 13.10 64-bit Unity, Eclipse 4.3.0, menus were not visible.

So I realise that it might be helpful if I clarify myself, the desktop shortcut file for Eclipse would contain something like this:

[Desktop Entry]
Version=4.3.0
Name=Eclipse
Comment=IDE for all seasons
#Exec=/home/USERNAME/Dokument/eclipse/eclipse
Exec=env UBUNTU_MENUPROXY=0 /home/USERNAME/Dokument/eclipse/eclipse
Icon=/home/USERNAME/Dokument/eclipse/icon.xpm
Terminal=false
Type=Application
Categories=Utility;Application

The row Exec=env UBUNTU_MENUPROXY=0 /home/USERNAME/Dokument/eclipse/eclipse, part referenced in the post I pointed to, is the one that makes menus visible, et voila! :)

In my case this file (eclipse.desktop) resides in /usr/share/applications/

Hope this helps.


I tried this by setting my eclipse path instead of the /home/USERNAME... , which is /opt/eclipse/eclipse. It seems that the fact that it is installed there forces me to run sudo eclipse in order to get the menus, or else it doesn't work. However, when I just copy-pasted your file content without modifying it, the menus work without sudo priviliges, even though I of course have no directory name /home/USERNAME... . I guess this might break some other functionality.
As Guildenstern said, it only works if I run Eclipse with superuser privileges, and my user profile isn't logically loaded. Is there a workaround without needing to use sudo?
This kind-of gets around the bug, thanks. However, if you're lazy like me and just want to wait around the bug fix to be released, Alt+<First Letter of Menu> seems to actually show the drop-down menu (albeit in the wrong place). Has anyone noticed the same menu misbehavior in other applications, i.e. Inkscape? I know DBeaver users experienced something similar (bugs.launchpad.net/ubuntu/+source/linux/+bug/1218687), I'm wondering if it's a system-wide bug...
Btw, bug 1221848 is a dupe, the official bug is here: bugs.launchpad.net/ubuntu/+source/eclipse/+bug/1208019
F
Figa17

You have to create a new file to open eclipse.

#!/bin/bash
export UBUNTU_MENUPROXY=0
path_to/eclipse/eclipse

I believe not using the menu proxy also makes Eclipse more responsive, but I'm not sure. Thanks!
Much prefer this solution for being explicit that a workaround is in place.
This is the right answer. I just downloaded the Android SDK.. no stinkin' .desktop file here >.<
B
Bosko Mijin

This bug has been confirmed in Ubuntu 13.10, here is a link. In order to overcome problem, you have to change your eclipse.desktop file in part of Exec passing env UBUNTU_MENUPROXY with eclipse path and eclipse will be runnable from launcher with functional menu bar. Here is patern for changing eclipse.desktop file:

Exec=env UBUNTU_MENUPROXY= path/to/eclipse

this works, but if you have an entry in ~/.local/share/applications, you need to edit that one
J
Josh Crozier

You should type export UBUNTU_MENUPROXY=0 before opening eclipse, and you have to open eclipse from the terminal instead of the global menu.


D
Desta Haileselassie Hagos

I had the same disabled sub-menus problem with Eclipse Kepler 64-bit on Ubuntu 13.10. But I finally managed to get it run with the following little work around. This bug has actually been already reported in this link.

Create a eclipse.desktop file in /usr/share/applications/with the following contents.

 [Desktop Entry]
  Version=4.3.0  
  Name=Eclipse
  Comment=IDE for all seasons
  Exec=env UBUNTU_MENUPROXY=0 /home/USERNAME/eclipse/eclipse
  Icon=/home/USERNAME/eclipse/icon.xpm
  Terminal=false
  Type=Application
  Categories=Utility;Application

or else, you could also try with the following executable bash script file which opens Eclipse. Place the file in /bin directory or /usr/local/bin.

#!/bin/bash
 export UBUNTU_MENUPROXY=0
 path_to/eclipse/eclipse

or for just the local user: ~/.local/usr/share/applications/ Or you could use the Alacarte menu editor.
actually you can create it anywhere and drag it to the launch bar.
Don't forget to delete spaces at the beginning of the each line.
W
Waqas

1) First, close eclipse and do this:

sudo gedit /usr/share/applications/eclipse.desktop

2) at the end of this file just copy-paste this line

Exec=env UBUNTU_MENUPROXY=0 /your/path/to/eclipse/binary

Open eclipse, the eclipse's menu will start showing up. (Works on On post Ubuntu version 12.04)


e
eebbesen

Nothing worked for me until I added the following line to the .profile file in my home folder and restarted my computer.

export UBUNTU_MENUPROXY=0

It worked for me.


t
throbi

For those who use the ADT (Android Developer Tools) bundle:

Create a launcher for eclipse edit /home//.local/share/applications/adt.desktop the way described by the accepted solution.

This will bring the menus back, however not integrated into the top bar.

Robert


"Create a launcher for eclipse". I'm trying to follow those instructions but can you clarify what you meant by that? Do you mean a launcher for the "eclipse" executable included with ADT? Thanks.
I
Ivan Klass

As for me, I found it better to edit eclipse starter itself, mine is /usr/bin/eclipse (root permission required).

Last line:

exec $ECLIPSE "$@"

becomes:

env UBUNTU_MENUPROXY=0 $ECLIPSE "$@"

So, now it doesn't matter how it starts - by desctop icon, terminal command or self-restart after new plugin installation.


I
Idemax

I solved it just opening my Eclipse by terminal as SU.

sudo ./eclipse

C
Community

The same question has been posted (and answered by me) on askubuntu:

Eclipse menus are cut off or don't show

Here is the complete answer.

How To solve Eclipse menu issues in Ubuntu 13.10

(Stable way, until someone fixes the bug)

This method takes for granted that you already have your eclipse.desktop file (or that you can alternatively create a new one from scratch). Otherwise, you can momentarily take a look at the "fast way" below.

Open your eclipse.desktop file: sudo -H gedit /usr/share/applications/eclipse.desktop (If you can't find it in this path, try in ~/.local/share/applications/eclipse.desktop. Otherwise, you could have to find yours using locate command). Replace the Exec= line with this: Exec=env UBUNTU_MENUPROXY= eclipse Where "eclipse" is the path to your eclipse executable. In this case it's just "eclipse" since there's a symlink in /usr/bin folder. NOTE: If you can't find your eclipse.desktop file, you can simply create one from scratch in the above path, and fill it with these lines: [Desktop Entry] Type=Application Name=Eclipse Icon=eclipse Exec=env UBUNTU_MENUPROXY= eclipse Terminal=false Categories=Development;IDE;Java; Save the file.

Now you can run Eclipse from its icon as usual.

(Fast but repetitive way)

If you haven't got any eclipse.desktop file and you don't want to create it at the moment, you can simply run Eclipse with this command:

UBUNTU_MENUPROXY= eclipse

where "eclipse" is the path to your eclipse executable. Note that this is just the fast way to run Eclipse once. If you don't want to remember this command and use it every time you have to run Eclipse, follow the "stable way" above.

Sources:

Keenformatics - How To show Eclipse menu in Ubuntu 13.10 Saucy Salamander (my blog)

Ubuntu documentation - EnvironmentVariables

Eclipse menus doesn't show up in Saucy


g
gunr2171

You can still access the menu using the ALT key :)


u
user1462586

What if I do not have such a file:

/usr/share/applications/eclipse.desktop

I guess you have that file, if you install eclipse from ubuntu repository.

If you install a standalone eclipse, then that file does not matter. And there is no such file over there.


You create your own file. First answer here explains everything askubuntu.com/questions/361040/…
A
Ashish Saini

close your eclipse if you have already launched eclipse application.

type this command on terminal

$ sudo gedit /usr/share/applications/eclipse.desktop

Note : you may found eclipse.desktop file in this path..../usr/share/applications/Eclipse

Add these lines in this file.

       [Desktop Entry]
       Version=4.3.0
       Name=Eclipse
       Comment=IDE for all seasons
       #Exec=/home/USERNAME/Dokument/eclipse/eclipse
       Exec=env UBUNTU_MENUPROXY=0 /home/ashish123/adt-bundle-linux-x86-20140702/eclipse/eclipse
      Icon=/home/ashish123/adt-bundle-linux-x86-20140702/eclipse/eclipse/icon.xpm
      Terminal=false
      Type=Application
      Categories=Utility;Application

s
stack1

Looks like the bug is still there, even in 14.10 with Eclipse Luna. My menus wont show. I setup eclipse using the tutorial here - http://ubuntuhandbook.org/index.php/2014/06/install-latest-eclipse-ubuntu-14-04/

and used that tutorial plus the top answer to make the desktop like this -

[Desktop Entry]
Version=4
Name=Eclipse
Comment=Integrated Development Environment
Exec=env UBUNTU_MENUPROXY=0 /usr/share/applications/
Icon=/opt/eclipse/icon.xpm
Terminal=false
Type=Application
Categories=Development;IDE;Java

Now, my eclipse won't even run.

With the desktop icon below, at least eclipse opens up -

[Desktop Entry]
Name=Eclipse 4
Type=Application
Exec=/opt/eclipse/eclipse
Terminal=false
Icon=/opt/eclipse/icon.xpm
Comment=Integrated Development Environment
NoDisplay=false
Categories=Development;IDE;
Name[en]=Eclipse

EDIT - Menus are now visible. I dunno what happened!