If you are a GNU Linux user, there are of course many distributions, you have your favorite one. And there is two ways to install Eclipse IDE:
- download the installer from the new eclipse.org download page, and the select the package you want (recommanded)
- download directly an archive of your favorite package on the eclipse.org package download page
But in both case, you will have to go in the installation folder to run Eclipse. Even the installer does not create a .desktop file, so you won’t find Eclipse in your distribution menu. And depending on your distro, it might not be possible to lock Eclipse icon to the launcher. As a regular Ubuntu user, with the Unity desktop, I like to have my favorite applications in the launcher.
Create a .desktop file
The solution is actually very easy: in the installation folder, create an empty file, name it Eclipse.desktop and copy paste this code:
[Desktop Entry] Version=Neon Name=Eclipse Comment=Eclipse is an IDE Exec=/home/username/path/to/eclipse Path=/home/username/path/to/eclipse/ Icon=/home/username/path/to/eclipse/icon.xpm Terminal=false Type=Application Categories=Utility;Application;Development;
Then, change the properties of the files so it can be executed. Just double click on it, and Eclipse should start. You will be able to lock the icon to the Launcher.
Of course, please change the path to your Eclipse installation. And if you have many installations, you can change the name field to make it more clear in the menu. You can also change the filename.
Add Eclipse to your menu
You now have a cool desktop launcher, but it is not yet available in your menu. To do that, copy the Eclipse.desktop file in:
/home/username/.local/share/applications
If you still can’t find Eclipse in the menu, just log out from your session or restart your computer. That should be good.
Improve the GNU Linux installer
I opened a bug on Bugzilla, for I think that the Oomph based installer should create the .desktop. If you agree with me and want to participate to the discussion, it is here:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=494735
By the way, creating a .desktop file is really a standard recommended by the Freedesktop.org. Gnome and KDE are following this standard:
- kde, https://techbase.kde.org/Development/Tutorials/Desktop_File
- gnome, https://developer.gnome.org/integration-guide/stable/desktop-files.html.en
- the reference example at freedesktop.com, https://specifications.freedesktop.org/desktop-entry-spec/latest/
Back in the GNOME 2 days, one could create launchers out of the box.
In the dark ages of GNOME 3, one have to create launchers manually…
isn’t it easier to package eclipse as .deb .rpm
or a new trend -> as a snappy package
Perhaps providing snaps could be great in the near future, but before we need to be sure that it will become a standard.
Thanks, helped me do fix my Neon launching problem with Ubuntu 16.04. If I start Eclipse and pin it to the launcher, trying to run it from the launcher causes a java exception. However starting Eclipse by a desktop file and pinning this to launcher works fine.
Thanks – your solution worked great!
you are welcome 🙂
Have you tried with standard Gnome and its dock? There doesn’t seem to be the context menu to add it to favorites (I created the desktop file and I can run it manually but then I cannot add it to the dock as favorite)…
No, only in Unity. But maybe I will update this when I switch to a newer version of Ubuntu with Gnome.
I see error “There was an error launching application” whats wrong here? I validated path
To me it doesn’t works this way.
It works doing this way:
1- creating a file eclipse.desktop in the same folder where I extracted it* was /home/USER/eclipse/java-2019-03/eclipse
*Obs.: which I have download from here: https://www.eclipse.org/downloads/
2- In the eclipse.desktop I use:
[Desktop Entry]
Encoding=UTF-8
Exec=/home/USER/eclipse/java-2019-03/eclipse/eclipse
Icon=/home/USER/eclipse/java-2019-03/eclipse/icon.xpm
Type=Application
Terminal=false
Comment=Eclipse Integrated Development Environment
Name=Eclipse
GenericName=Eclipse-2019-03
StartupNotify=false
Categories=Development;IDE;Java;
3- I copy the file eclipse.desktop using a terminal with the path:
sudo cp Eclipse.desktop /usr/share/applications/
And ok its done! Eclipse icon just appears in my menu (programming) section!
I use Linux Mint (cinnamon) 19.1