简体   繁体   English

升级到Ubuntu 13.10后,Eclipse菜单不显示

[英]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. 升级到Ubuntu 13.10之后,当我单击Eclipse中的任何菜单(“帮助”,“窗口”,“运行”)时,它们都不会显示。 Only menu stubs and selection are visible. 仅菜单存根和选择可见。

屏幕截图

I tried installing fresh 4.3 and the same thing is happening. 我尝试安装最新的4.3,并且发生了相同的事情。 Is anyone else experiencing this behavior? 还有其他人遇到这种行为吗?

The same question has been answered on askubuntu: 在askubuntu上回答了相同的问题:

Eclipse menus are cut off or don't show Eclipse菜单被关闭或不显示

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. 我遇到了与您描述的相同的问题,Ubuntu 13.10 64位Unity,Eclipse 4.3.0,菜单不可见。

So I realise that it might be helpful if I clarify myself, the desktop shortcut file for Eclipse would contain something like this: 因此,我意识到,如果我澄清一下自己的话,Eclipse的桌面快捷方式文件将包含以下内容可能会有所帮助:

[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! 我所指的帖子中引用的行Exec=env UBUNTU_MENUPROXY=0 /home/USERNAME/Dokument/eclipse/eclipse是使菜单可见的行,瞧! :) :)

In my case this file ( eclipse.desktop ) resides in /usr/share/applications/ 就我而言,此文件( eclipse.desktop )驻留在/usr/share/applications/

Hope this helps. 希望这可以帮助。

You have to create a new file to open eclipse. 您必须创建一个新文件才能打开eclipse。

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

This bug has been confirmed in Ubuntu 13.10, here is a link . 此错误已在Ubuntu 13.10中得到确认,这是一个链接 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. 为了解决问题,您必须在Exec传递带有eclipse路径的env UBUNTU_MENUPROXY的部分Exec中更改eclipse.desktop文件,并且可以从具有功能菜单栏的启动器中运行eclipse。 Here is patern for changing eclipse.desktop file: 这是更改eclipse.desktop文件的模式:

Exec=env UBUNTU_MENUPROXY= path/to/eclipse

您应该在打开eclipse之前键入export UBUNTU_MENUPROXY=0 ,并且必须从终端而不是全局菜单中打开eclipse。

I had the same disabled sub-menus problem with Eclipse Kepler 64-bit on Ubuntu 13.10. 我在Ubuntu 13.10上使用Eclipse Kepler 64位时遇到了相同的禁用子菜单问题。 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. /usr/share/applications/具有以下内容的eclipse.desktop文件。

 [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. 否则,您也可以尝试使用以下可执行的bash脚本文件打开Eclipse。 Place the file in /bin directory or /usr/local/bin . 将文件放在/bin目录或/usr/local/bin

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

1) First, close eclipse and do this: 1)首先,关闭Eclipse并执行以下操作:

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

2) at the end of this file just copy-paste this line 2)在此文件的末尾,只需复制粘贴此行

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

Open eclipse, the eclipse's menu will start showing up. 打开eclipse,eclipse的菜单将开始显示。 (Works on On post Ubuntu version 12.04) (适用于Ubuntu 12.04后版本)

Nothing worked for me until I added the following line to the .profile file in my home folder and restarted my computer. 在我将以下行添加到主文件夹中的.profile文件并重新启动计算机之前,对我没有任何帮助。

export UBUNTU_MENUPROXY=0

It worked for me. 它为我工作。

For those who use the ADT (Android Developer Tools) bundle: 对于使用ADT(Android开发人员工具)捆绑包的用户:

  1. Create a launcher for eclipse 为Eclipse创建启动器
  2. edit /home//.local/share/applications/adt.desktop the way described by the accepted solution. 按照接受的解决方案描述的方式编辑/home//.local/share/applications/adt.desktop。

This will bring the menus back, however not integrated into the top bar. 这将使菜单返回,但未集成到顶部栏中。

Robert 罗伯特

As for me, I found it better to edit eclipse starter itself, mine is /usr/bin/eclipse (root permission required). 对于我来说,我发现最好编辑eclipse启动程序,我的是/usr/bin/eclipse (需要root权限)。

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. 因此,现在它的启动方式无关紧要-通过desctop图标,终端命令或安装新插件后自行重启。

我只是通过终端以SU打开Eclipse来解决它。

sudo ./eclipse

The same question has been posted (and answered by me) on askubuntu: 在askubuntu上发布了相同的问题(并由我回答):

Eclipse menus are cut off or don't show Eclipse菜单被关闭或不显示

Here is the complete answer. 这是完整的答案。


How To solve Eclipse menu issues in Ubuntu 13.10 如何在Ubuntu 13.10中解决Eclipse菜单问题

(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). 此方法认为您已经拥有eclipse.desktop文件(或者可以从头开始创建一个新文件)是理所当然的。 Otherwise, you can momentarily take a look at the "fast way" below. 否则,您可以暂时查看下面的“快速方法”。

  1. Open your eclipse.desktop file: 打开您的eclipse.desktop文件:

     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). (如果在此路径中找不到它,请尝试~/.local/share/applications/eclipse.desktop 。否则,您可能必须使用locate命令来locate )。

  2. Replace the Exec= line with this: 用以下代码替换Exec=行:

     Exec=env UBUNTU_MENUPROXY= eclipse 

    Where "eclipse" is the path to your eclipse executable. 其中“ eclipse”是您的eclipse可执行文件的路径。 In this case it's just "eclipse" since there's a symlink in /usr/bin folder. 在这种情况下,它只是“蚀”,因为/usr/bin文件夹中有一个符号链接。

    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: 注意:如果找不到eclipse.desktop文件,则可以简单地在上述路径中从头开始创建一个文件,并用以下几行填充:

     [Desktop Entry] Type=Application Name=Eclipse Icon=eclipse Exec=env UBUNTU_MENUPROXY= eclipse Terminal=false Categories=Development;IDE;Java; 
  3. Save the file. 保存文件。

Now you can run Eclipse from its icon as usual. 现在,您可以照常从其图标运行Eclipse。

(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: 如果您没有任何eclipse.desktop文件,并且现在不想创建它,则可以使用以下命令简单地运行Eclipse:

UBUNTU_MENUPROXY= eclipse

where "eclipse" is the path to your eclipse executable. 其中“ eclipse”是您的eclipse可执行文件的路径。 Note that this is just the fast way to run Eclipse once. 请注意,这只是一次运行Eclipse的快速方法。 If you don't want to remember this command and use it every time you have to run Eclipse, follow the "stable way" above. 如果您不想记住该命令并在每次运行Eclipse时都使用它,请遵循上面的“稳定方式”。


Sources: 资料来源:

您仍然可以使用ALT键访问菜单:)

close your eclipse if you have already launched eclipse application. 如果您已经启动了Eclipse应用程序,请关闭您的Eclipse。

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 注意:您可能会在此路径中找到eclipse.desktop文件。.../ 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

What if I do not have such a file: 如果我没有这样的文件怎么办:

/usr/share/applications/eclipse.desktop /usr/share/applications/eclipse.desktop

I guess you have that file, if you install eclipse from ubuntu repository. 如果您从ubuntu存储库安装eclipse,我想您就有该文件了。

If you install a standalone eclipse, then that file does not matter. 如果安装独立的Eclipse,则该文件无关紧要。 And there is no such file over there. 而且那边没有这样的文件。

Looks like the bug is still there, even in 14.10 with Eclipse Luna. 看起来该错误仍然存​​在,即使在14.10中使用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/ 我使用此处的教程设置了eclipse- 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 - 使用下面的桌面图标,至少会打开eclipse-

[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! 我不知道发生了什么事!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM