Ubuntu – How to pin Eclipse to the Unity launcher


How can I pin eclipse indigo 3.7 I have 'installed' at /opt/ to the taskbar?

I have tried launching eclipse and right-clicking to choose the 'keep in launcher' option. But when I click that icon, after closing eclipse, it doesn't start eclipse.

I have already looked at How do I add Eclipse Indigo to the launcher? but no answer worked for me. (Mod note: The answers from this thread are now merged into this one)

Best Answer

  • For 11.10 and newer

    First, create a .desktop file to eclipse:

    gedit ~/.local/share/applications/opt_eclipse.desktop

    Then, paste this inside (dont forget to edit Exec and Icon values):

    [Desktop Entry]
    Comment=Eclipse Integrated Development Environment
    Icon=** something like /opt/eclipse/icon.xpm **
    Exec= ** something like /opt/eclipse/eclipse **

    After that, open that folder with nautilus:

    nautilus ~/.local/share/applications

    If you want to use this launcher outside dash/launcher (ex: as a desktop launcher) you need to add execution permission by right clicking the file and choosing Properties -> Permissions -> Allow execution, or, via the command-line:

    chmod +x ~/.local/share/applications/opt_eclipse.desktop

    Finally drop opt_eclipse.desktop to launcher.