0

I have followed the instructions in many answers like this one to create a proper launcher for everyone's very favorite user friendly IDE installed from tar (otherwise I would get a very old version from USC). A few hours later I still can't make it run.

I installed eclipse on ~/opt/eclipse/, (in order to run it today I open a terminal and type opt/eclipse/eclipse) so I filled out the Exec field as Exec=$HOME/opt/eclipse/eclipse. This might be error 1, what should I put there instead?

In the Icon field, I wrote the path to the eclipse icon in the same folder: $HOME/opt/eclipse/icon.xpm. What should I replace this with? the .eclipse anatomy was my reference for using the $HOME variable. From memory, the following steps were taken:

  1. cd /usr/share/applications/
  2. sudo touch eclipse.desktop
  3. sudoedit eclipse.desktop (heads up: only sudoedit can write on that file)

    [Desktop Entry]
    Name=Eclipse
    Type=Application
    Exec=$HOME/opt/eclipse/eclipse
    Comment=Launches eclipse IDE
    Icon=$HOME/opt/eclipse/icon.xpm
    
  4. ls -l eclipse.desktop

    -rw-r--r-- 1 root root 139 Jul 5 21:41 eclipse.desktop

And now when I type eclipse on the Dash, all I get is a shortcut to eclipse's icon.xpm. Is there an error in my .desktop file, provided eclipse is in ~opt/eclipse/eclipse? Is it necessary to copy the eclipse icon to /usr/share/pixmaps? Thanks in advance.

1

It turns out, as one first commenter pointed, I can't use $HOME (or any environment variable) in a .desktop file. I have to use the literal path or a more elaborate command. And having copied the icon to /usr/share/pixmaps/eclipse.xpm, just writing Icon=eclipse is enough to create an icon. Therefore, my eclipse.desktop looks like this:

    [Desktop Entry]
    Name=Eclipse
    Type=Application
    Exec=/home/[my username]/opt/eclipse/eclipse
    Comment=Launches eclipse IDE
    Icon=eclipse

And it works! Thanks to all who helped.

Not the answer you're looking for? Browse other questions tagged or ask your own question.