Create a Linux desktop entry

How to create a Linux desktop menu item. Sometimes we may need to install software in a fashion other than the package manager. One of these programs is the newest or the latest Eclipse IDE. Let’s go through the process of installing the latest Eclipse IDE.

Go to https://www.eclipse.org/downloads/ to download the latest Eclipse.

 

https://www.eclipse.org/downloads/
We need to locate the downloaded file, and we need to unzip this file.

When we install a program via the package manager, we can launch the newly installed program, via the [Menu], but when we install a program without the package manager, the [Menu] has no idea we installed this program, so we have to tell the [menu] where to find this newly installed program.

The Eclipse Installer will install the executable into a directory of your choice. Usually with Linux, we choose /opt or /usr/local as our install location, but in this case, I am using the home directory.

Once we install the program to the home directory, we need to create a desktop entry, so our menu will know we installed this new program, and how to open the program. We need to change to the /usr/share/applications directory, which houses the desktop menus.

Now we need to create a file with the format of programname.desktop. Here we will create a file eclipse.desktop with a text editor. Inside this file, is the following code:

[Desktop Entry]
Type=Application
Name=Eclipse Java
Comment=Eclipse Integrated Development Environment
Icon=/home/ron/eclipse/java-2018-09/eclipse/icon.xpm
Exec=/home/ron/eclipse/java-2018-09/eclipse/eclipse
Terminal=false
Categories=Development;IDE;Java;

Now when we go to [Menu –> Programming –> Eclipse Java] the program Eclipse IDE will open. Now we have a menu link to use instead of having to find the Eclipse folder executing the binary.