Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am installing the newer application eclipse Juno on ubuntu 12.04 64bit, following this tutorial: http://www.blogs.digitalworlds.net/softwarenotes/?p=54. I have already installed Eclipse Indigo in the past (the already version, found in Ubuntu repos). Note that I may be using the Eclipse as an example here, but I have came across this behaviour in other cases too.

So, the original Eclipse Indigo .desktop file is the following:

[Desktop Entry]
Type=Application
Name=Eclipse
Comment=Eclipse Integrated Development Environment
Icon=eclipse
Exec=eclipse
Terminal=false
Categories=Development;IDE;Java;

I changed it though a bit for the sake of installing the new Eclipse Juno side by side with the old one. To the above file became:

[Desktop Entry]
Type=Application
Name="Eclipse Indigo"  #<------THIS CHANGED
Comment=Eclipse Integrated Development Environment
Icon=eclipse
Exec=eclipse
Terminal=false
Categories=Development;IDE;Java;

Finally I generate the .desktop file for eclipse juno, NOT in the way instructed by the guide but with the command

gnome-desktop-item-edit --create-new ~/applications

The contents of the file are:

#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Icon[en_US]=/opt/eclipse/icon.xpm
Name[en_US]=Eclipse Juno
Exec=/opt/eclipse/eclipse
Comment[en_US]=Eclipse Juno 4.2.2 IDE
Name=Eclipse Juno
Comment=Eclipse Juno 4.2.2 IDE
Icon=/opt/eclipse/icon.xpm

Now starting the application uses the newer Juno icon and hovering the icon says (surely enough) "Eclipse Juno".

So far, so good. However, if I start the application from the CLI , with /opt/eclipse/eclipse, I get the icon of Eclipse Indigo showing up on the launcher and hovering this icon says "Eclipse Indigo". However, it is Juno that has been started (which is what I wanted).

In the following picture, the top icon (in the red rectangle) is the Eclipse Juno. In the bottom icon is again Eclipse Juno, but started from the command line. Thank you for your help.

img

EDIT: ok, ~/applications is taking more fame than it should. This is just a personal folder to keep applications, binaries and other personal stuff. I created the files in my personal folder and then copied the generated .desktop files in /usr/share/applications.

share|improve this question
    
Are you sure you put the .desktop file in ~/applications and not ~/.local/share/applications? –  Glutanimate Aug 29 '13 at 19:35
add comment

1 Answer 1

up vote 9 down vote accepted
+50

Why did you create your desktop file in ~/applications directory? This desktop file should be placed into /usr/share/applications or into ~/.local/share/applications.

The right and successful way to do this is to use Main Menu (it can be installed with sudo apt-get install alacarte command). Search for it in Dash or you can open it from Terminal with this command:

alacarte

After it opens, follow the instructions in the image below:

alacarte

You can check after in ~/.local/share/applications if you have a new desktop file for Eclipse Juno. The name of the new fesktop file should be something like alacarte-made-x.desktop (where x is a number). And now if you want a copy of this file in your ~/applications directory, you can copy it there without no problem.

And another one important thing: use the full path to the application for command (Exec=/path/to/eclipse) in both desktop files.

See also:

share|improve this answer
    
+1 for nice visual instruction ;) –  moon.musick Aug 29 '13 at 20:35
    
Hi there, thank you for the answer. However, I come across another problem down the road. Please see this following question. –  nass Aug 30 '13 at 17:52
    
Didn't work for me in Ubuntu 14.04. opening the newly created .Desktop file in .local/share/applications/ from Nautilus gives an error :Untrusted application launcher. The application launcher “alacarte-made.desktop” has not been marked as trusted. If you do not know the source of this file, launching it may be unsafe. –  faizal Jul 7 at 9:43
1  
@faizal Yes, because you didn't make it executable (chmod +x filename...) –  Radu Rădeanu Jul 7 at 9:46
    
Ahh thanks. It works now. I am still having a related problem. Please see askubuntu.com/questions/492642/… –  faizal Jul 7 at 9:50
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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