将 Eclipse 图标锁定到启动器

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22048827/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 21:32:40  来源:igfitidea点击:

Locking Eclipse Icon to Launcher

eclipseubuntu

提问by Farhan Javed

I am running Ubuntu 12.04 LTS 64-bit. I recenetly downloaded eclipse kepler from their website and it runs fine and all that. But one thing i noticed was that it was a downloaded archive file, and it wasn't installed on the system. When I launch the icon to the launchbar, it does not open it the next time. And upon restart, the icon is gone. Kindly help me out here. Thank you.

我正在运行 Ubuntu 12.04 LTS 64 位。我最近从他们的网站上下载了 eclipse kepler,它运行良好。但是我注意到的一件事是它是一个下载的存档文件,并且没有安装在系统上。当我将图标启动到启动栏时,它下次不会打开它。重新启动后,图标消失了。请帮助我。谢谢你。

回答by Farhan Javed

I figured it out after sometime. In order to do so, make a desktop file of the same name of the executable file for example eclipse.desktop in this case. Type the following in the file:

过了一段时间我想通了。为此,请制作与可执行文件同名的桌面文件,例如本例中的 eclipse.desktop。在文件中键入以下内容:

[Desktop Entry]
Version = 1.0
Name=Eclipse
Comment=Used to run C++
Exec= "Path to the executable of the application"
Icon="Path to the icon of the application"
Terminal=false
Type=Application
Categories=Application;

Save the file and then right click on it and click Properties. Go to the Permissions tab and then check allow executing file as program.

保存文件,然后右键单击它并单击“属性”。转到“权限”选项卡,然后选中“允许将文件作为程序执行”。

Launch eclipse from it and then pin it to the Launcher. Done and Done.

从中启动 eclipse,然后将其固定到 Launcher。完成和完成。

回答by Vanessa Deagan

I'm using Ubuntu 15.04 with Eclipse Mars (4.5.0) and did not need to perform any of the above. All I did was:

我在 Eclipse Mars (4.5.0) 上使用 Ubuntu 15.04,不需要执行上述任何操作。我所做的只是:

  1. Download Eclipse
  2. Uncompress:tar -zxvf eclipse-java-mars-R-linux-gtk-x86_64.tar.gz
  3. Copy to /opt directory: sudo mv ./eclipse /opt
  4. Open Nautilus and navigate to /opt/eclipse
  5. Run Eclipse by double clicking eclipse
  6. Right-click on Eclipse in the launcher and select Lock to Launcher
  1. 下载日食
  2. 解压:tar -zxvf eclipse-java-mars-R-linux-gtk-x86_64.tar.gz
  3. 复制到 /opt 目录: sudo mv ./eclipse /opt
  4. 打开 Nautilus 并导航到 /opt/eclipse
  5. 双击运行 Eclipse eclipse
  6. 在启动器中右键单击 Eclipse 并选择 Lock to Launcher

Eclipse is now in my launcher and works as expected.

Eclipse 现在在我的启动器中并按预期工作。

回答by PJ_Finnegan

I had the same problem when rolling back from Mars to Luna on Ubuntu 16.04. Turns out there was a dirty file left by Mars in:

在 Ubuntu 16.04 上从 Mars 回滚到 Luna 时,我遇到了同样的问题。结果发现火星留下了一个脏文件:

~/.local/share/applications/eclipse.desktop

created when I had locked Mars to the panel the first time and pointing to the deleted Mars folder. Problem solved by:

当我第一次将 Mars 锁定到面板并指向已删除的 Mars 文件夹时创建。问题解决:

  1. Quitting the instance of Luna.
  2. Removing the said file.
  3. Starting Luna from command line.
  4. Right mouse click on the panel icon -> Lock to Launcher.
  5. Quit Luna again.
  1. 退出 Luna 实例。
  2. 删除所述文件。
  3. 从命令行启动 Luna。
  4. 鼠标右键单击面板图标 -> 锁定到启动器。
  5. 再次退出露娜。

Naxt time it should start by clicking the panel icon.

下次它应该通过单击面板图标开始。

The advantage of re-creating automatically the desktop file this way is that Eclipse is launched with the correct parameters, i.e.:

以这种方式自动重新创建桌面文件的优点是使用正确的参数启动 Eclipse,即:

Exec=/usr/bin/java -Dosgi.requiredJavaVersion=1.6 -XX:MaxPermSize=256m -Xms40m -Xmx512m -jar ...

回答by user3816621

The simplest way is: Start your App and on Launcher menu click right-mouse button on your app and choose "Lock to Launcher"

最简单的方法是:启动您的应用程序,然后在启动器菜单上单击应用程序上的鼠标右键并选择“锁定到启动器”

回答by thiruvenkadam

Even though it is nearly an year old and I cannot find a relevant question in the SO, I am adding my own answer which worked for me :-)

尽管它已经快一年了,我在 SO 中找不到相关问题,但我添加了我自己的答案,这对我有用:-)

The easiest way is to create a shortcut to the downloaded eclipse in the /usr/bin directory and pin it to the launcher.

最简单的方法是在 /usr/bin 目录中为下载的 eclipse 创建一个快捷方式,并将其固定到启动器。

# cd $ECLIPSE_DIRECTORY
# ln -s eclipse /usr/bin/eclipse

And then launch the eclipse like you normally do. Then Right Click on the Eclipse icon in the launcher and Click on Lock To Launcher in the context menu properties.

然后像往常一样启动日食。然后右键单击启动器中的 Eclipse 图标并单击上下文菜单属性中的锁定启动器。

回答by Sparsh

The most simple and effective way.

最简单有效的方法。

Go to usr/share/applicationsfolder and find Eclipse icon. Right click on it and select copy to desktop.

转到usr/share/applications文件夹并找到 Eclipse 图标。右键单击它并选择复制到桌面。

Thats it. Now double click on this icon and it will run.

就是这样。现在双击这个图标,它就会运行。