I can start Eclipse directly from the executable in /home/USERNAME/eclipse. When I do this, the Eclipse icon on the dock has a little arrow next to it, so it is aware of Eclipse running. How strange.
–
csilkMay 3 '12 at 20:17

1

I've had the same error, I was trying to execute eclipse_64bit on ubuntu_32bit. Have you downloaded 64bit version of Eclipse? Have you checked your ubuntu installation?
–
user61448May 7 '12 at 20:54

i think you dont need the /bin/sh part in the Exec section. Remove it and it should work. By the way, what is your username?
–
SalemAug 7 '12 at 12:38

If you want to use this launcher outside dash/launcher (ex: as a desktop launcher) you need to add execution permission by right clicking the file and choosing Properties -> Permissions -> Allow execution,
or, via the command-line:

Is it really necessary to create the .desktop file outside user's home folder? As you can see, this requires sudo, which is potentially unsafe; also, the file may be removed by a system upgrade or reinstall. What are the benefits?
–
SergeyNov 16 '11 at 23:50

No, you can create the file where you want. I suggested this location because it's the folder where usually .desktop files are stored (so it is "found" by applications like unity, gnome do, etc). The name is unfortunate, because it's the same of the .desktop file created by eclipse package, when installed by Software Manager. I'll change it.
–
SalemNov 17 '11 at 0:09

16

~/.local/share/applications is probably where you want to put it.
–
Jorge CastroNov 17 '11 at 4:15

I also had to append StartupWMClass=eclipse at the end of the .desktop file, or else Unity was unable to detect if an instance was already running or not (thus trying to re-launch eclipse each time, and failing due to locks on the workspace)
–
alciMar 8 '12 at 9:29

11.04

If user21580's answer doesn't work (great suggestion, but I think it didn't work for me when I installed Indigo), you can try adding an eclipse.desktop file to ~/.local/share/applications/, with these contents:

This doesn't pick up the icon of the app, and when dragged into the Unity task bar, it spawns yet another icon for the app. Don't mean to troll, but the experience of creating a shortcut in OS X or Windows is way, way better.
–
Dan DascalescuNov 7 '14 at 20:48

You should add this to /usr/local/share/applications/eclipse.desktop and symlink eclipse on /usr/bin.
You might want to change the icon path if your theme doesn't have a eclipse button (ex. ambiance/radiance).

If I'm not mistaken this is the file that comes with galileo from the repos (wich I removed), and I've been using it with Helios and now Indigo.

If you have donwloaded Eclipse from the website instead of install it from repositories you can lock the launcher doesn't work.
You can solve this by writting the file with extension .desktop, in our case eclipse.desktop.

If not using a *.deb file, your software is not included in menus or the launcher.
The easy way:
Just start Eclipse from /opt and look for an icon appear in Unity launcher (the sidebar). Right click and check "Keep in launcher".

Type = Application in Terminal THIS ONLY APPLIES THIS TIME. Most of the time it will be Application after this.

8- You can name what you wish. NO-SPACES-ALLOWED I called mine Create-Launcher

9- In the command field put the path to the script from step 3

/home/mike/bin/launcher-script Use your user name and the actual file name you created.

10- Click the spring to add an icon. I made on on the Gimp but there are lots of icons you could use that are very generic and already installed. Click the spring and it will take you to some.

11- Once you're finished click ok. Now you can navigate your file browser down to /usr/share/applications and you will find your new launcher. Simply drag it to your launcher bar and you are ready to go. This process puts your launchers in a place where all users can access them. Most of what I have found puts thing on the desktop which might be fine for some but not for me. I hope you find this helpful.

Now you can easily create your eclipse launcher and any others too.

After thought, every time you create a new launcher you will have to enter your password. This is necessary to make the new launcher accessible to all users. It will belong to root and the group will be root this way. That is the way the rest of the system comes configured. If you cd to /usr/share/applications, type ls -l and, verify for yourself. Ubuntu should have supplied their os with an application already installed for creating launchers. There are other things I disagree with like the screensaver and no short cut to the desktop. I have only been on 11.10 for a couple days. I am going to give it the college try. If I still don't like it in a month I will fix it then.

In the exec line put the executable (eclipse) directly. Don't try to add special characters to space, i.e., if your eclipse is in the /home/username/My Dev Programs/Eclipse/eclipse put the entire line with the spaces on the exec line. Here is a my eclipse.desktop file: