2

So I installed the latest eclipse using the eclipse installer, which installs everything to a folder in your home directory. I tried

sudo ln -s eclipse

from the directory where I launch eclipse, but I still cannot open eclipse anywhere from my terminal using just

eclipse

Additionally, I uninstalled the older (3.8) version of eclipse, and when I use gnome-do, the only launcher it finds is the old eclipse, which no longer does anything. I can work around this by creating "eclips.desktop" with the right info, but if this is renamed to "eclipse.desktop" the old launcher is used, including the old icon.

I'm on ubuntu 14.04 running gnome-flashback if that affects anything. Thanks for the help

Shatnerz
  • 143

1 Answers1

0

New launcher:

The old launcher is one of those two files:

  • /usr/share/applications/eclipse.desktop
    
  • /home/YOUR_USERNAME/.local/share/applications/eclipse.desktop
    

Delete whichever of these files exists.

Then you can just launch Eclipse by directly running its executable and then right-click on its launcher icon and select "Lock to launcher". This will probably create a simple .desktop file for Eclipse in the second location listed above (in your home directory).

Or if the automatic generation this way fails, you can still create s simple little .desktop file manually. Follow the steps below or look at How to pin Eclipse to the Unity launcher?

  1. Open your favourite text editor, for example gedit.

  2. Paste these lines into the editor:

    [Desktop Entry]
    Type=Application
    Name=Eclipse
    Comment=Eclipse Integrated Development Environment
    Icon=~/eclipse/java-mars/eclipse/icon.xpm
    Exec=~/eclipse/java-mars/eclipse/eclipse
    Terminal=false
    Categories=Development;IDE;Java;
    StartupWMClass=Eclipse
    
  3. Replace the path for Icon= and Exec= with the correct locations, if needed.

  4. Save the file as ~/.local/share/applications/eclipse.desktop.

  5. If it doesn't appear in the Dash's application lens, log out and back in.

New command:

To get an eclipse terminal command, follow the steps described below.
I will assume that the Eclipse executable is ~/eclipse/java-mars/eclipse/eclipse (that's how I remember the default installation path, please correct me if I'm wrong).

  1. Create the directory ~/bin (default directory for custom or user-specific binaries) if it doesn't exist yet:

    mkdir ~/bin
    

    Ignore possible errors that end with File exists.

    Only if ~/bin did not exist yet (or if you're not sure), you have to do this step to let the Shell know that it should look for executables here:

    • Close and reopen the terminal window or run the command below to re-source the .profile script.

      source .profile
      
  2. Make a symbolic link to the Eclipse executable inside ~/bin.

    ln -s ~/eclipse/java-mars/eclipse/eclipse ~/bin/eclipse
    
  3. Make the new link executable for your user:

    chmod u+x ~/bin/eclipse
    

Now you should be able to just enter eclipse into your terminal to open the IDE.

Byte Commander
  • 110,243