1. Terminal code:
Cd/home/xyh/desktop
sudo gedit eclipse.desktop
then type in the file that pops up:
[CPP]View Plaincopyprint?
- [Desktopentry]
- Encoding=utf-8
- Name=eclipse
- Comment=eclipse IDE
- Exec=/usr/local/eclipse/eclipse_sdk/eclipse
- icon=/usr/local/eclipse/eclipse_sdk/icon.xpm
- Terminal=false
- Startupnotify=true
- Type=application
- Categories=application;development;
exec=/usr/local/eclipse/eclipse_sdk/Eclipseicon=/usr/local/eclipse/eclipse_sdk/icon.xpm
This place is to be modified for your Eclipse installation directory.
PS: My eclipse is installed (or unzipped) in the/usr/local/eclipse directory
2. Then give the file the right to run the "chmod u+x eclipse.desktop" command.
This eclipse is the decompression installation, if it is installed with the Deb package, you can put/usr/share/applications/under the eclipse.desktop (I have not installed, do not know whether it is the name) files copied to the desktop directory.
3. Direct CP above the code of the friend notice, CP back to edit the note to remove the space behind each line.
There are also two commands, which are related to the desktop icon
desktop-file-install Install icon icon to application directory
desktop-file-validate Verifying the correctness of your desktop icon file
For example, my command can add an Eclipse icon that is already installed on my desktop to the Start menu.
desktop-file-install-- Add-category Development Eclipse.desktop