Ubuntu – Starting eclipse from unity launcher

eclipselauncherunity

I downloaded the eclipse from its site. And extracted in home folder. For the first time when I opened it, it worked fine. Then I locked it to launcher. Now it's not starting when I click on launcher icon in eclipse but it starts when I start it from the folder where I extracted it. Please tell some way to keep it in launchcer and open it from t here only.

Thanks.

[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Name=Java - SnapdealOMS/src/main/java/com/snapdeal/oms/admin/web/controller/ReloadCacheController.java - Eclipse 
Icon=eclipse.png
Path=/home/nakulkumar/Downloads/eclipse
Exec=/usr/bin/java -Dosgi.requiredJavaVersion=1.6 -XX:MaxPermSize=256m -Xms40m -Xmx512m -jar /home/nakulkumar/Downloads/eclipse//plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar -data /home/nakulkumar/Snapdeal_workspace -os linux -ws gtk -arch x86_64 -showsplash /home/nakulkumar/Downloads/eclipse//plugins/org.eclipse.platform_4.4.0.v20140925-0400/splash.bmp -launcher /home/nakulkumar/Downloads/eclipse/eclipse -name Eclipse --launcher.library /home/nakulkumar/Downloads/eclipse//plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20140603-1326/eclipse_1605.so -startup /home/nakulkumar/Downloads/eclipse//plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar --launcher.appendVmargs -exitdata 34000f -product org.eclipse.epp.package.java.product -vm /usr/bin/java -vmargs -Dosgi.requiredJavaVersion=1.6 -XX:MaxPermSize=256m -Xms40m -Xmx512m -jar /home/nakulkumar/Downloads/eclipse//plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar
StartupNotify=false
StartupWMClass=Eclipse
OnlyShowIn=Unity;
X-UnityGenerated=true

Best Answer

Normally, When you run Eclipse from a downloaded version, it should create a correct .desktop file in ~/.local/share/applications on first run.

In this case, for some reason, some lines were messed up:

  • The Exec= -line should simply show the path to your executable.
  • The Name= -line obviously went (terribly) wrong as well

How to fix

Just replace:

  • The line starting with Exec= by:

    Exec=/path/to/your/eclipse_executable
    

    (most likely, looking at your Path= -line, it should be: Exec=/home/nakulkumar/Downloads/eclipse/eclipse)

  • The line starting with Name= by:

    Name=Java - Eclipse
    

As a comparison, this is the .desktop file Eclipse created on my system:

[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Name=Java - Eclipse 
Icon=eclipse
Path=/home/jacob/eclipse
Exec=/home/jacob/eclipse/eclipse
StartupNotify=false
StartupWMClass=Eclipse
OnlyShowIn=Unity;
X-UnityGenerated=true
Related Question