How hard can it be?

Eclipse LogoThe taskbar is all new and shiney in Windows 7 but it appears that it’s really hard for these newfangled collections of open-and-closed programs to just allow a shortcut. Ubuntu has Unity and one of the first things I came across was that I couldn’t keep some programs in the ‘taskbar’on the left  (I don’t really know how Ubuntu calls it) . Same goes for Eclipse in Windows it seems. I’m using a 64 bit version of both Windows and Eclipse. Eclipse version is 4.1.1

It’s a bug!

After some google-fu I found this ‘double entry in the taskbar’ bug. The bug is not the same (“Eclipse icon is duplicated in taskbar”), but it seems the problem has the same cause and we can actually use one of the tricks down in the comments! Winz. My guess is the origional bug starts when you upgrade your Eclipse and allready have an Icon: then you have an icon you use to start eclipse, which makes a second non-pinable entry in the taskbar. To get from there to ‘my’ problem: just remove the first pin :)

Getting the “pin to taskbar” to show

From this comment by ‘riccardo’ we can figure out that an extra line or 2 is needed in the eclipse.ini file. Adding the location of the VM should fix all your sores.

  1. If you haven’t: remove any old pinned eclipse icons.
  2. Find your eclipse directory, and the eclipse.ini file.
  3. Add the following 2 lines:
    -vm
    disk:\path\to\JRE\bin
  4. Save
  5. Run, and wait for the main screen to show (so not the splash or the workspace chooser)
  6. Right click, choose pin, have a drink.

These are the complete contents of my current eclipse.ini file:

-vm
C:\Program Files\Java\jre7\bin
-startup
plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.100.v20110502
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Xms40m
-Xmx384m

 

After starting eclipse the first lines were automagically changed to this, but I don’t really think that matters :)

-vm
C:/Program Files/Java/jre7/bin

Troubles

Things can go wrong. You can read the comments of the linked bug above, but some common problems are:

  • Not giving the ‘-vm’ and ‘path’ lines a separate line.
  • Unstable behavior of Eclipse. Haven’t gotten that, but if you do, you can remove the ‘-vm’ line after pining.
  • If you update your JRE, you might need to update the path too in your ini, I’m not really sure.
  • Some people need a full reboot for any of this to work. (I didn’t by the way)

And while windows 8 is a whole new beast, it can’t hurt to add this tip in the comments by “VinnyJames”:

If you move the icon after pinning and before exiting eclipse it may not stick (this happens to me on Windows 8.1).

vm in ini, start, wait, pin, move pinned icon, exit = fail
vm in ini, start, wait, pin, exit, move pinned icon = success

40 comments on How to get Eclipse to “Pin to taskbar” in Windows 7

  1. Cam says:

    This didn’t work for me. Now right clicking the Eclipse icon just does nothing? Has anyone else had this happen?

  2. Nanne says:

    Hmm, obviously this worked for me (otherwise I wouldn’t have posted it :) ), so I don’t know if I can help a lot.

    The only thing I can think of is you may have forgotten to remove the previously pinned thingy?

    If you find out what your problem is btw, please post it here ;)

  3. Cam says:

    Just tried it again and it worked! Looks like a restart might have been needed, though I can’t think why.

  4. ennaN says:

    Hmm, me neither (some form of cache?), but glad it worked :)

  5. Richard says:

    Awesome, thanks for the tip about waiting for the window to fully load before right clicking and pinning to the task bar. That double icon bug was really irritating me!

  6. Panos says:

    this works for me after adding these two lines….
    -vm
    C:\Program Files\Java\jre7\bin
    if you already have a shortcut in taskbar remove this first, open eclipse.exe, and when it opens right click on taskbar icon and pin to taslbar…

  7. […] This is handy if you find yourself with duplicate Eclipse icons in your Windows taskbar. […]

  8. Mark says:

    thanks, worked great!

  9. Christos says:

    -vm
    C:\Program Files\Java\jre6\bin

    it works very well.
    I am now able to pin eclipse on taskbar!
    thanks man.

  10. sabbib says:

    Worked for me. um using juno. love the interface, but i think its kinda unstable. crashes abit too often. does anyone else have the same problem?

  11. Nanne says:

    The biggest issue I have is having projects on a (slow) network connection, like samba. Indexing etc is really slow over samba, so that is a showstopper. Not getting crashes related to other things, I think.

  12. christophe says:

    Thank you,

    you made my day !

  13. Jamie Pate says:

    If you have stability problems (or speed issues with juno) make sure you have the latest java (7) and that it’s using java 7 (it helped a whole bunch for me)

  14. Eric Anderson says:

    Thanks! This worked perfectly for eclipse Juno!

  15. cirovladimir says:

    Thanks, it worked like a charm!

    You should stress the “add 2 lines” comment (probably splitting into 2 steps). It had me wondering for a while… silly me :P

  16. ennaN says:

    I changed it a bit, does this help?

  17. Glyn Jones says:

    Hi I would like to know how you can reply so that the recipient gets a ‘tracked reply’ message? I cannot find this on AndroBlip and I am using 2.2.0 version.
    Many thanks

  18. Nanne says:

    Sorry to say you cannot. The feature isn’t build and currently there are no plans to build it either: blipfoto does not release this feature to the public (through the API), so I can’t implement it.

  19. Eric says:

    Thank you for helping to keep my taskbar neat and tidy :)

  20. Phuah Yee Keat says:

    Thanks! Worked like a charm. Interested to know what’s the real reason though, is it Eclipse will modify its own arguments when it starts up?

  21. Nanne says:

    I’m really not sure. I think the problem is that the application-id is different because it is run from javaw, but adding the VM line makes Eclipse do this internally, so without changes to the id?

    This is just guessing by the way, the whole thing is quite ridiculous :)

  22. Giancarlo says:

    It worked also on Eclipse Kepler

  23. Paolo M says:

    Working correctly on Windows 8, eclipse 4.2.2 from the ADT

  24. Pesse says:

    Thanks alot – worked for me!

  25. siva says:

    For me an error happening with an msg “Could not create JVM”.
    When I click ok, it shows a big modal dialog containing eclipse.ini contents. within which I found these args two times, one is pointing to win32\javaw.exe. (which I did not add, and wasn’t there when I was adding). For now, I returned back, waiting for any trick you may send to my email ID sivatumma@gmail.com

  26. Mike says:

    This is incredible…thank you! Works for J2EE Kepler and replaces the “gear” icon with the standard :)

  27. Carlos says:

    Great!, it worked even for the ADT Bundle.

  28. Kyle Wiering says:

    Adding the lines to end of the .ini in Kepler causes a failure in loading the java Virtual Machine. As pictured, make sure to place the -vm as the first line.

    @siva – I suspect this is the problem you encountered.

  29. Kyle Wiering says:

    Note: This same method applies to windows 8.

  30. Jairo says:

    Great!!!! thank you very much, it worked really good after changing the path , in my case I had to leave it this way

    -vm
    /Program Files/Java/jre7/bin

    greetings!

  31. Michael Wolf says:

    This still works in 2014! running kepler!

    Thank you!

    -vm
    \Program Files\Java\jre7\bin

  32. Jeremy Alexander says:

    Or you can drag and drop the exe to the taskbar

  33. Oliver says:

    Thanks for the help!

    I had to add the 2 lines BEFORE everything else in the .ini (or else I got the error of creating a vm). Working with Win8.1 and Kepler

  34. singh9526 says:

    Thank you so much, it worked perfectly for me. I was searching for this problem and was so frustrated by it not working out, but you post solved this problem for me!
    Thank you so much!

  35. Vinnyjames says:

    In the Troubles section you should mention that if you move the icon after pinning and before exiting eclipse it may not stick (this happens to me on Windows 8.1).

    vm in ini, start, wait, pin, move pinned icon, exit = fail
    vm in ini, start, wait, pin, exit, move pinned icon = success

  36. ennaN says:

    Ah, thanks for that! I’ve added it!

  37. Thanks buddy. Worked like charm..

  38. crazycoder says:

    Worked great. Thank you so much.

  39. Mike says:

    Doesn’t work for Luna, unfortunately. (It was fine for Kepler.)