87

All other apps that can be pinned to the taskbar behave well. But Eclipse doesn't show recently open projects when I right click it. It also doesn't allow to pin some projects inside it. Note that I have the JS version of Eclipse Helios. Which spawns a new and different taskbar icon after loading.

Jader Dias
  • 81,082
  • 147
  • 410
  • 611
  • I found that if I drag eclipse.exe from windows explorer onto the taskbar it allows me to pin it too. – danca Sep 14 '14 at 15:23

7 Answers7

100

Specify the latest available Java VM in your eclipse.ini. I.e.:

-vm
jdk1.6.0_10\jre\bin\client\jvm.dll
  1. Make sure they are on separate lines
  2. Anything after the "vmargs" is taken to be vm arguments

(More info)

Or alternatively add the java bin folder to your Windows PATH before the "windows32" folder, because otherwise eclipse uses "javaw.exe" in the win32 folder instead of the JDK one.

Community
  • 1
  • 1
whlk
  • 14,969
  • 13
  • 64
  • 93
  • 11
    See Bug 314805: https://bugs.eclipse.org/bugs/show_bug.cgi?id=314805#c40 I just use the "bin" directory under the jdk, e.g. -vm C:/Program Files/Java/jdk1.7.0_02/bin – usethe4ce Jan 26 '12 at 18:51
  • 3
    I'm using jdk1.6.0_25 and instead of `client` I have a `server` directory, which contains `jvm.dll`. Specifying this path as the `-vm` argument works with Eclipse Java EE (Indigo Service Release 2). – Kohányi Róbert May 04 '12 at 05:51
  • 26
    At first neither option was working for me (Eclipse 4.2 32 bit, Windows 7 64 bit, JDK 1.6 32 bit). Then I tried the following: 1. Right click on eclipse.exe -> Properties -> Compatibility, enable compatibility mode with Windows XP Service Pack 3. 2. Run Eclipse. 3. Wait until the workspace is loaded. 4. Pin to the taskbar. 5. Close Eclipse. 6. Removed compatibility settings from eclipse.exe. 7. Run Eclipse. Still not working! 8. Unpin from taskbar and pin again. (???) 9. And NOW it works... – MarioVilas Jul 14 '12 at 16:37
  • 1
    Wow, Marios way was the first to work for me. Note, that I also had to set the "-vm ..." argument in eclipse.ini (otherwise it would not allow pinning at all) and that I did not have "Windows XP Service Pack 3" but "Windows Vista" compatibility, probably because I use Eclipse in 64bit... – Steffen Heil Jul 27 '12 at 07:13
  • Hehe, @MarioVilas trick also worked for me. I have doubts however, if running in the compatibility mode has any sideeffects? If yes, what might that be? Slower compilation? – lobner Aug 14 '12 at 12:15
  • 3
    I used solution 2 - adding the bin folder to Windows PATH. I'd already done that, so to get things right, I also needed to unpin Eclipse, since I'd pinned it before I'd updated the path, and then re-pin it after starting it directly out of the eclipse folder. – Dale Oct 13 '12 at 13:00
  • Second solution worked for me too. Thank you. I had been dragging that annoying little issue for ages. – eskalera Nov 22 '12 at 16:29
  • Unfortunately, this seems like it'll break when I upgrade Java – Casebash Dec 06 '12 at 05:21
  • 1
    Running as administrator worked for me. They you can pin to the taskbar in Windows 7, right click the pinned shortcut, remove the Run as Admin checkbox, and it stays and behaves – biddulph.r May 01 '13 at 15:33
  • Adding the '-vm' option with the path to 'bin' worked for me, but as the bug linked in another comment stated it had to be the first two lines. – Adam Sep 08 '14 at 15:03
  • If you're not getting a right-click menu appearing at all, reboot your system. I had some funky business whereby no menu appeared at all when I right-clicked the taskbar icon. This was after a few attempts at editing my eclipse.ini file. After I rebooted the system, the taskbar right-click menu appeared and I could pin the icon. Seems like windows was caching something somewhere. – Ryan Bennetts Sep 30 '14 at 04:51
  • I made the change above and it broke my eclipse ... so this is not the right solution. – Knows Not Much Oct 04 '14 at 15:41
28

Riccardo's solution from the Eclipse bug report worked for me, but I don't get recently opened projects, etc. from the task bar. Is anyone experiencing that these workarounds restore that behavior?

I have the same problem on Windows 7 x64 with Helios x64, but for me the following workaround works with the option "Always combine, hide labels" for taskbar buttons.

  • Check your "eclipse.ini" for the specified VM and make sure the path points to the bin directory of your JDK or JRE (and not to javaw.exe). For me the argument is "D:/Development/Languages/Java/Development Kit/bin/" without quotes.
  • Unpin Eclipse from the taskbar or delete the shortcut
  • Run "eclipse.exe" from the explorer and choose your workspace
  • Pin Eclipse to the taskbar after the splash screen was loaded and when the main window is shown
Jeff Axelrod
  • 25,625
  • 29
  • 137
  • 239
15

setting eclipse.exe to compatibility mode works

coder
  • 1,183
  • 1
  • 12
  • 18
  • 1
    Hahah you know, I didn't try this at first because it sounded too easy, yet it is what worked for me. Now I can have Helios and Indigo pinned to my taskbar with no issues. Note: I also still have the .ini edits in place as well. Thank you! +10000000 – Jack May 24 '12 at 13:50
  • Don't forget to remove the `-vm` parameter after setting to compatibility mode. When I had both, the Eclipse didn't manage to start at all. – fracz Jan 02 '13 at 10:05
  • 3
    This works in Windows 7 by setting compatibilty mode to Windows Vista. – starryknight64 Nov 11 '14 at 17:48
  • With Eclipse Mars it has unfortunate side effect of crashing EGit – Aivar Jan 13 '16 at 13:14
4

I just want to add this for the Win10 users.

Edit eclipse.ini to add these lines at the end before the line --launcher.appendVmargs:

-vm C:/Program Files/Java/jdk1.8.0/jre/bin/server/jvm.dll

You need set the compatibility to Windows Vista as well in order for it to work.

Pieter van Niekerk
  • 838
  • 15
  • 42
3

I think it's important to mention that at least for me it was important to add the path to the vm in the eclipse.ini with forward slashes, even though I'm working with Windows (7, that is). Eclipse didn't start when I used backslashes.

Campfire
  • 774
  • 1
  • 5
  • 12
2

Recently Timo Kinnunen has pinpointed the problem

Edit eclipse.ini find the line:

--launcher.appendVmargs:

and change it to

--launcher.appendVmargs:-vm <PATH_TO_JAVA>/jdk1.8.0/jre/bin/server/jvm.dll

This causes the JVM to be launched in the same process as eclipse.exe rather than as a child process and avoids the intricacies of Host Processes with AppUserModelIDs.

And it works !!!

Andy Braham
  • 7,763
  • 4
  • 38
  • 44
Epicurist
  • 775
  • 10
  • 17
2

The solutions offered here on StackOverflow so far, don't have an easy fix for running multiple Eclipses while each having their own Application ID, and making grouping of icons work as expected. The answer here does provide a reference to the underlying System.AppUserModel.ID property.

Here's a quick HOWTO:

  1. Do the -vm setting as plenty of people here have mentioned
  2. Run the eclipse app
  3. Right click on the running taskbar icon, Pin this program to taskbar
  4. Navigate to %AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\Taskbar
  5. Copy the newly created shortcut to another location. It will be named eclipse, eclipse (2), or eclipse (3) and so on
  6. Right click on the running taskbar icon, Unpin this program from taskbar
  7. Use the Shortcut Properties dialog to copy all individual fields (target + parameters, workdir, icon, anything else) to the new shortcut
  8. Rename the new shortcut
  9. Drag the new shortcut to the Windows Taskbar
  10. Done

Here's an extended HOWTO, helpful if you want icon grouping separated per individual Eclipse instance (if you have multiple instances running):

  1. Find out what your startup plugin is, for example org.eclipse.epp.package.java_2.0.1.20130919-0803. Open the plugin.xml file of that folder.
  2. Edit the following XML location in that file: /plugin/extension/product/property[@name="appName"], set attribute value to something else. Don't use spaces, keep length below (up until) 40.
  3. Optionally also set the window title: /plugin/extension/product/property[@name], set attribute name to something else.
  4. In your existing Eclipse shortcut, append -clean and run it once. You will notice the //product/property[@name] attribute being used in the Eclipse window title. Afterwards, you can remove -clean again.
  5. Follow the quick HOWTO above

A quick explanation on What's going on here:

  1. Inside the .lnk file, an attribute is stored, which can't be entered by using the windows Shortcut Property dialog. If you copy a .lnk file, the attribute will copy with it.
  2. Windows groups by identical System.AppUserModel.ID property, AppID for short
  3. Eclipse does not have an AppID at startup. First the JVM is started, then the eclipse core/platform is started, and then the startup plugin is loaded. In this last stage, an API call is done to set the AppID to the value inside a plugin.xml file. See above: extended HOWTO item 2
  4. When you drag a manually created shortcut .lnk file to the taskbar, it makes sense that windows can't put this AppID into the new 'pinned' version of the .lnk file. It can only be detected at runtime.
  5. When you start an Eclipse application, right click on the running taskbar icon, Pin this program to taskbar -> then Windows will detect the AppID and store it in the 'pinned' .lnk. But, partly because of the JVM process redirection, Windows does not detect the command-line parameters, environment, working folder (at startup at least), and the icon path + icon index. So you have to:
    1. Do a file copy of the .lnk file and fill in the missing gaps yourself
    2. Or, use a shortcut creation tool that understands System.AppUserModel.ID properties (there are plenty)
    3. Or, use the Windows API directly

Sincerely hope this will reduce the amount of haywire Eclipse taskbars icons on the workstations around me,

Cheers, TW

Community
  • 1
  • 1
Tw Bert
  • 3,470
  • 16
  • 24