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

2
  • I'm an idiot. I was only checking /usr/share/applications/eclipse.desktop. I still have no idea why creating a link isn't allowing me to run it using eclipse from the terminal.
    – Shatnerz
    Jan 8, 2016 at 16:42
  • You probably created the link in the wrong place and/or did not make it executable. See my answer below and don't forget to accept it (click the grey tick symbol on the left of it) if it solved your problem. :-)
    – Byte Commander
    Jan 8, 2016 at 16:55

1 Answer 1

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.

3
  • So it looks like neither launcher exists. I did accept this answer as the "New Command" solution was mostly what I was looking for
    – Shatnerz
    Jan 8, 2016 at 19:18
  • @Shatners I added another method to create the launcher.
    – Byte Commander
    Jan 8, 2016 at 19:56
  • 1
    Thanks, everything is good now. I just realize I couldn't initially create the command correctly because I was using ln -s name /usr/bin/name instead of ln -s /home/myself/name/name /usr/bin/name
    – Shatnerz
    Jan 15, 2016 at 16:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .