Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 314805

Summary: [Win32] Eclipse icon is duplicated in taskbar
Product: [Eclipse Project] Equinox Reporter: Spyrus <arxidiamidia>
Component: LauncherAssignee: Niraj Modi <niraj.modi>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: 0RUBn0, aaronkelley, abdo_fci, abuehler, alex.scal, ameller, arunkumar.thondapu, benjiecooper, bhseclipse, boutinaud.pub, brent.longstaff, bugs.eclipse.org, bvitale3002, clappi, contact.imeszaros, dajoker, daniel_megert, davidac, dream3r, eclipse.felipe, eclipse, egalvez, elh.mailgate, evan.kirshenbaum, faeryfyrre, fionnziegler, gattacus, Graeme.Bryce, greensopinion, gvsmirnov.cp, hans_hans74, henrik, hoffmann.frank.germany, huksley, iain, icyitscold, ignjic, ituden.uiron, jan, jason.cheung.ireland, jcompagner, jgarrison, juancarlos.penuela, kaloyan, kentxu2007, klaidliadon, kleind, kohenkatz, kwesoly, larryd, lechuza05+eclipsebugs, leo, lshanmug, markus.kell.r, mauromol, mikhail.nemtsev, moneyistaste, mpcarl, mrichar2, mukund, mwisnicki, niraj.modi, nobody, noone.junkmail, patryk.ozga, radamand, riccardo.nimser, robert, ronnypolley, russell.davis, samstgt, shawn.minto, Sheehan.simon19, silvio.ginter, simon.lieschke, software.architekt, sptaszkiewicz, tbuschto, thomas.thuem, timo.kinnunen, tjwatson, vladnc, ykphuah
Version: 3.6   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
See Also: https://git.eclipse.org/r/55435
Whiteboard: stalebug
Bug Depends on: 432353    
Bug Blocks:    

Description Spyrus CLA 2010-05-28 02:29:00 EDT
When i run the application after splash screen is loaded, a new icon is
on the taskbar, like i could have 2 instances of Eclipse running
Comment 1 Steffen Pingel CLA 2010-05-28 04:16:18 EDT
Thanks for the report. Do you remember seeing this with previous Helios RC or milestones of the Java package?

Shawn, do you have any thoughts on this?
Comment 2 Steffen Pingel CLA 2010-05-28 14:08:28 EDT
I am moving this to platform since this problem is not specific to the EPP Java package.
Comment 3 Andy Thompson CLA 2010-05-29 03:29:11 EDT
I also have this problem. 64-bit version on Windows 7

It occurs if you pin Eclipse to the task bar. When running it, a new task bar entry shows after the splash screen.

Also the new entry doesn't have standard menu items such as "Pin/unpin this program to/from the taskbar" or "<program name>" which launches a new instance of the program (unless its a single instance app).

Eclipse 3.5 used the original entry, but then I guess this bug is caused by something in the new Windows 7 jump list code.
Comment 4 Spyrus CLA 2010-05-29 10:51:30 EDT
(In reply to comment #1)
> Thanks for the report. Do you remember seeing this with previous Helios RC or
> milestones of the Java package?
> 
> Shawn, do you have any thoughts on this?

Have not used the Helios in Windows 7 before.
What Andy Thompson says is correct
Comment 5 Spyrus CLA 2010-05-31 04:11:08 EDT
(In reply to comment #4)
> (In reply to comment #1)
> > Thanks for the report. Do you remember seeing this with previous Helios RC or
> > milestones of the Java package?
> > 
> > Shawn, do you have any thoughts on this?
> 
> Have not used the Helios in Windows 7 before.
> What Andy Thompson says is correct



RC2 Windows 64-bit version (Eclipse for JAVA Developers - build)
does the same with icon, test it today
Comment 6 Shawn Minto CLA 2010-05-31 13:59:05 EDT
Hi All, I think that Andy is right about the jump list addition that could have caused this since the application id could (and probably is) be different for the eclipse.exe and what is added by SWT.  I just downloaded RC3 and I see this behavior when I add a shortcut or the exe to the windows task bar, but if I pin a running version of Eclipse, then it behaves as expected.
Comment 7 Spyrus CLA 2010-06-14 03:09:41 EDT
(In reply to comment #6)
> Hi All, I think that Andy is right about the jump list addition that could have
> caused this since the application id could (and probably is) be different for
> the eclipse.exe and what is added by SWT.  I just downloaded RC3 and I see this
> behavior when I add a shortcut or the exe to the windows task bar, but if I pin
> a running version of Eclipse, then it behaves as expected.



RC4 has this issue also.
When eclipse.exe is pinned to taskbar and then clicked to run,
a second icon is shown in the taskbar. (Windows 7 x64)
Comment 8 daniel CLA 2010-06-17 18:50:24 EDT
I can also confirm this happen when using Eclipse 64bit only on Windows 7.

I believe this is due to Eclipse being run off the javaw.exe process instead of eclipse.exe when running in 64bit.
Comment 9 Brian Hauer CLA 2010-06-24 14:49:34 EDT
Also seeing this on Windows Server 2008 R2 ("Windows 7 Server").  I just updated to Helios from Galileo.  Galileo did not exhibit this behavior.

If you pin the splash-screen's icon, its highlight will disappear once the main Eclipse window opens.  On the other hand, if you pin the main Eclipse window's icon, the icon will change to a Java coffee cup and once Eclipse is closed, it cannot be re-opened with this pinned icon.
Comment 10 Jun Zhou CLA 2010-06-27 23:29:15 EDT
Same behavior on Windows Server 2008r2 64bits and Windows 7 64bits.

When I pinned "eclipse.exe" to taskbar and click it, a new icon appears.

When right click the new icon, the pop menu has three items: "New task", "Active task" and "Close". The first two were not usable, a dialog says "Could not create the Java virtual machine." appears when click them.
Comment 11 brent.longstaff CLA 2010-06-29 15:56:41 EDT
This is a huge problem for windows 7 users, it breaks switching to eclipse via the taskbar with the keyboard shortcut unless you drag the icon over to the slot you want every time you start the app.
Comment 12 ruland CLA 2010-06-30 07:08:46 EDT
The bug can be reproduced with Windows 7 and final Helios release. It is very annoying.
Comment 13 kurrija CLA 2010-06-30 07:21:28 EDT
(In reply to comment #8)
> I can also confirm this happen when using Eclipse 64bit only on Windows 7.
> 
> I believe this is due to Eclipse being run off the javaw.exe process instead of
> eclipse.exe when running in 64bit.

Looks to me, like daniel pretty much hit the spot, as during the splash screen the correct taskbar icon will be used.
Only once eclipse 64bit finishes loading does the new icon appear.

My system is pretty much the same as noted by the others:
Windows 7 x64
Eclipse Helios 64-bit (eclipse.buildId=I20100608-0911)
Comment 14 Andreas Buehler CLA 2010-06-30 07:23:39 EDT
As a workaround, wouldn't it be possible then to create some cmd or bat file which starts eclipse directly through the javaw process, not by the eclipse.exe?
Comment 15 István Mészáros CLA 2010-06-30 08:13:24 EDT
(In reply to comment #14)
> As a workaround, wouldn't it be possible then to create some cmd or bat file
> which starts eclipse directly through the javaw process, not by the
> eclipse.exe?

A possible workaround was mentioned before by Shawn Minto at 2010-05-31 13:59:05 EDT, scroll up a bit. It works for me (win7 64bit)
Comment 16 Andreas Buehler CLA 2010-06-30 08:28:09 EDT
Thank you, I tried that, but I can't pin a "running version". There is no "pin this programm to the taskbar" action on the running eclipse instance. There is only "new task", "activate task" and "close" available as mentioned in comment #3 from Andy.
I'm using Windows 7 64bit with Eclipse Helios Release
Comment 17 Bryan CLA 2010-06-30 15:49:51 EDT
(In reply to comment #15)
> A possible workaround was mentioned before by Shawn Minto at 2010-05-31
> 13:59:05 EDT, scroll up a bit. It works for me (win7 64bit)

This workaround doesn't work for me either. If you pin the icon of the running Eclipse instance to the task bar, the icon turns into a generic Java app icon. If you quit Eclipse and try to use this icon to launch Eclipse, it doesn't work.
Comment 18 dream3r Mising name CLA 2010-07-05 18:12:41 EDT
It is working fine for me with latest stable version (3.6). 
Confirmed on Win7 64bit Ultimate and Win7 64bit Professional
Comment 19 Steffen Heil CLA 2010-07-06 02:04:21 EDT
I can confirm this bug with german windows 7. I am getting an additional icon once the splash screen disapears that only has one item on it's pin list: "Fenster schließen" (=close).

I did not have such problems with galileo, but I never tried the RCs.

Having lots of pinned application this leads to trouble, because trying to switch to eclipse leads to starting a new instance, which (luckily) fails, because the workspace is in use.
Comment 20 Silvio Ginter CLA 2010-07-06 03:09:49 EDT
(In reply to comment #19)
> ... I did not have such problems with galileo, but I never tried the RCs.

I also can confirm this problem on Windows 7 x64 with Helios x64. I tried the x86 RC-2 of PDT 2.2 Release, which did not show this issue. The final x86 behaves like the final x64.

Bye
Comment 21 Riccardo Mising name CLA 2010-07-06 04:07:48 EDT
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
Comment 22 Gleb CLA 2010-07-06 05:03:59 EDT
(In reply to comment #21)

> - 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)

Worked for me: now I can pin a running eclipse instance to taskbar, and after I have closed it, it still runs eclipse when clicked.
Comment 23 Andreas Buehler CLA 2010-07-06 05:08:10 EDT
The workaround in comment #21 worked for me too. (Windows 7 x64, Helios x64)
Now the "Pin this programm to the taskbar" action is available (which it wasn't before) and I'm able to launch eclipse from the taskbar.
Comment 24 Darren Taft CLA 2010-07-06 05:36:59 EDT
There was mention of editing the path in eclipse.ini to work around this issue. I don't have a path set in that file, however I've just updated my system path environment variable to reference "C:\Program Files\Java\jre6\bin" as the first entry, and I too now have the ability to pin the running app to my Taskbar.  This now works exactly as it should, on Windows 7 Enterprise 32-bit edition.

Previously, there was no specific java mention, so it was using javaw.exe from the Windows\System32 directory (which is at the same version as the one in the path I've now directly referenced).

The only thing I appear to have lost is that the Taskbar icon used to change according to the perspective being used, whereas now it always shows the normal Eclipse icon. That's no loss to me though.
Comment 25 Bryan CLA 2010-07-06 15:01:08 EDT
I tried the workaround (adding -vm to eclipse.ini). I now have a problem where Eclipse sometimes crashes when it restarts itself. For example, when I switch workspaces and Eclipse restarts, or if I install a plugin and let Eclipse restart, I'll get a Windows error stating "eclipse.exe has stopped working". I do not get this crash without the "-vm" option in eclipse.ini. It would be interesting to know if anyone else is observing this behavior.
Comment 26 Bryan CLA 2010-07-06 15:09:34 EDT
I was able to avoid the crash mentioned above by doing the following: 1. Apply the workaround (add the "-vm" to eclipse.ini). 2. Pin the icon to the taskbar. 3. Once you have the icon pinned, remove the "-vm" parameter from eclipse.ini.

Also to note, the workaround did not work for me at first - right clicking on the icon in the taskbar did not bring up the taskbar context menu, instead it was acting like a left-click. I reinstalled Eclipse to get around that and I was then able to right click on the icon.
Comment 27 Patryk Ozga CLA 2010-07-10 18:52:43 EDT
My eclipse.ini in the root folder doesn't reference javaw.exe anywhere in the file, obviously I'm looking at the wrong eclipse.ini. Where should I look for the correct one?
Comment 28 Spyrus CLA 2010-07-12 04:05:58 EDT
(In reply to comment #27)
> My eclipse.ini in the root folder doesn't reference javaw.exe anywhere in the
> file, obviously I'm looking at the wrong eclipse.ini. Where should I look for
> the correct one?

YOU should make the reference by adding the -vm flag + the path to javaw
Read Comment#21 - it says that he has the -vm, but yes the default ini
does not have any, so added yourself.
Comment 29 Alex Scal CLA 2010-07-15 04:37:38 EDT
I got this issue after upgrading to Oracle JVM (1.6.0_u21).

I am using Windows 7 Professional and Eclipse 3.6

What worked for me is the following:
- removed the -vm option from eclipse.ini (which was pointing to javaw 1.6.0_u21)
- start eclipse
- select pin to desktop
- add the -vm back to eclipse.ini
- close eclipse and reopen it.

This worked for me.

Hope it helps.

Moreover there is another bug related to Oracle JVM
See https://bugs.eclipse.org/bugs/show_bug.cgi?id=319514

Alex
Comment 30 Jim Garrison CLA 2010-07-15 12:18:10 EDT
(In reply to comment #29)
> What worked for me is the following:
> - removed the -vm option from eclipse.ini (which was pointing to javaw
> 1.6.0_u21)

I'm running Eclipse 64-bit on Windows7-64 with Java 6u20 64-bit.  To add to the confusion, my solution differs in that my eclipse.ini didn't have a -vm option, and I had to ADD it, pointing to the 64-bit JDK bin directory.  Then the remaining steps worked and I now have only one taskbar icon.
Comment 31 Radamand CLA 2010-07-17 12:55:59 EDT
I still cant pin the running eclipse to the taskbar, when i right click on the running program's icon absolutely nothing happens, no popup menu, nothing...
Comment 32 Eddie Galvez CLA 2010-07-20 10:18:57 EDT
Related to that last comment -- I'm not sure Helios even supports pining properly? I mean, "Pin this program to taskbar" doesn't appear when running Helios -- only options about Mylyn (in my case, since I'm running the RCP developer version)
Comment 33 IanG CLA 2010-07-28 05:25:58 EDT
I've tried all of the supposed fixes to no avail.
I added the -vm arguement, but that made no difference.
No matter what I do, when Eclipse is running, I don't have the option to "pin to taskbar". All I have is "new task" or "activate task"
Hopefully this can be fixed with an update or something :/
Comment 34 IanG CLA 2010-07-28 05:43:59 EDT
Scratch that, apparently where you position the "-vm" and path in eclipse.ini makes a difference.
When I had "-vm" and the path on the same line, no pin option. Now that I have "-vm" on its own line, and the path on the next, I have the pin option, and it works correctly.
Thanks to all who have helped :]
Comment 35 Gerry Kaplan CLA 2010-08-05 17:20:13 EDT
(In reply to comment #34)
> Scratch that, apparently where you position the "-vm" and path in eclipse.ini
> makes a difference.
> When I had "-vm" and the path on the same line, no pin option. Now that I have
> "-vm" on its own line, and the path on the next, I have the pin option, and it
> works correctly.
> Thanks to all who have helped :]

I have this same problem and none of the solutions worked. I added the -vm with the path to javaw.exe on a separate line - I got a context menu but it doesn't have "pin to taskbar". I checked to see which vm it's using from the help/config screen and it is properly pointing to the new jvm. I also accomplished this by putting %JAVA_HOME% at the beginning of my path (In front of WIndows stuff) and it accomplished the same thing.
Comment 36 Kent Xu CLA 2010-08-09 20:32:43 EDT
> What worked for me is the following:
> - removed the -vm option from eclipse.ini (which was pointing to javaw
> 1.6.0_u21)
> - start eclipse
> - select pin to desktop
> - add the -vm back to eclipse.ini
> - close eclipse and reopen it.

This worked for me. I unpinned the old icon and removed the -vm option. Then I launched eclipse and waited until it completely finished loading before I pin it. Then I can put the -vm option back. It's either the -vm option or the waiting that helped.
Comment 37 José Antonio Matute CLA 2010-08-11 11:44:01 EDT
I've tried all the "tricks" said before, but anything works for me.  My enviroment is:

Windows 7 (32bits)

java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode, sharing)

Eclipse Java EE IDE for Web Developers.
Version: Helios Release
Build id: 20100617-1415

Any ideas?
Comment 38 Henrik Heimbuerger CLA 2010-08-22 14:39:46 EDT
Very annoying, I could not find a workaround for this. What I've tried:
* no -vm argument in the eclipse.ini (taking c:\windows\system32\javaw.exe)
* -vm argument with Java\jdk\bin\javaw.exe
* -vm argument with Java\jdk\jre\bin\javaw.exe
* -vm argument with Java\jre6\bin\javaw.exe

Eclipse 3.6.0 (classic, 64-bit), Win7 x64 Professional, Java 1.6.0_21 (64-bit).

In all of these cases, I always get the Mylyn jumplist, but never the "pin to taskbar" option. When I pin the shortcut directly, a second one appears after launch.
Comment 39 Henrik Heimbuerger CLA 2010-08-22 14:43:28 EDT
Also tried running Eclipse in Vista/2k8 compatibility mode, hoping that this would disable the jumplist code, but then Eclipse doesn't launch at all (EXCEPTION_ACCESS_VIOLATION by the JVM).

Does anybody have an idea how Eclipse could be launched in compatibility mode? Maybe that could be a workaround until the actual bug is fixed.
Comment 40 Larry D CLA 2010-08-22 14:55:53 EDT
I was able to pin eclipse to the taskbar on Win 7 x32 and x64 with the following lines in eclipse.ini:

-vm 
c:\java\jdk1.6.0\bin

The "-vm" must be on a separate line, followed by the path to the java bin folder (just the "bin" folder, do not include javaw.exe!).
I have placed these on the first two lines of the eclipse.ini file.
Comment 41 hans_hans74 CLA 2010-08-22 17:13:44 EDT
Adding the vm flag to the eclipse.ini file made me able to pin the icon to the taskbar, but there occured one further problem.

I have several eclipse installations (a "normal" JEE one and one JEE with the GWT plugin). Then I did following things:
1. Started "normal" Ecplise and pinned the icon to the taskbar after fully launched and workbench is shown.
2. Start GWT Eclipse, workspace launcher appears, a separate icon appears for the launcher.
3. After loading the GWT eclipse instance the workbench appears, but the icon in the taskbar integrates into the normal eclipse icon pinned in step 1. So only one icon remained.

I definitely uses two different eclipse installations and I expect two different icons in the taskbar, that worked for Ganymede perfectly, but not for Helios.

I think, the particular bug is a replica of the following: https://bugs.eclipse.org/bugs/show_bug.cgi?id=305789
Comment 42 Vineet Reynolds CLA 2010-08-27 18:13:40 EDT
None of the workarounds described here worked for me. This included the workarounds to use a vm argument that pointed to the bin directory of the JDK and the JRE.

After studying quite a bit of this on other forums, it appeared that the problem was due to removal of the IsShortcut value of the lnkfile key in the Windows registry (HKEY_CLASSES_ROOT\lnkfile).

Reference: http://www.sevenforums.com/general-discussion/1364-cant-pin-into-taskbar-build-6956-a.html
Comment 43 Vineet Reynolds CLA 2010-08-27 18:18:50 EDT
(In reply to comment #42)
> None of the workarounds described here worked for me. This included the
> workarounds to use a vm argument that pointed to the bin directory of the JDK
> and the JRE.
> 
> After studying quite a bit of this on other forums, it appeared that the
> problem was due to removal of the IsShortcut value of the lnkfile key in the
> Windows registry (HKEY_CLASSES_ROOT\lnkfile).
> 
> Reference:
> http://www.sevenforums.com/general-discussion/1364-cant-pin-into-taskbar-build-6956-a.html

By the way, I was referring to the inability to pin the Eclipse icon to the taskbar.

For the record, I could observe a second Eclipse icon in the taskbar during the launch of the application, that disappears as soon as a workspace is opened.
Comment 44 Jonathan Kruse CLA 2010-09-17 16:27:08 EDT
I have tried all of the suggestions in this thread and none have worked.  When I add either of the following
-vm
C:\Program Files\Java\jre6\bin

or 

-vm
C:\Program Files\Java\jdk1.6.0_21\bin

Eclipse launches and I see the icon quickly disappear in the taskbar and a new one is added once the workspace loads.  If I right click the Eclipse icon in the taskbar I get no options.  Nothing happens.  When I remove the -vm and corresponding path all of the same is true, but I am able to right-click and get a close option.  I've tried various combinations of all of the suggestions here, including the registry tweak, and none have fixed this.

I am running Windows 7 Ultimate 64 Bit and Eclipse 3.6.0.  Are there any other suggestions?  Is there a plan to correct this as I have not had this problem in any previous versions of Eclipse?
Comment 45 Jonathan Kruse CLA 2010-09-17 16:38:46 EDT
(In reply to comment #44)
> I have tried all of the suggestions in this thread and none have worked.  When
> I add either of the following
> -vm
> C:\Program Files\Java\jre6\bin
> 
> or 
> 
> -vm
> C:\Program Files\Java\jdk1.6.0_21\bin
> 
> Eclipse launches and I see the icon quickly disappear in the taskbar and a new
> one is added once the workspace loads.  If I right click the Eclipse icon in
> the taskbar I get no options.  Nothing happens.  When I remove the -vm and
> corresponding path all of the same is true, but I am able to right-click and
> get a close option.  I've tried various combinations of all of the suggestions
> here, including the registry tweak, and none have fixed this.
> 
> I am running Windows 7 Ultimate 64 Bit and Eclipse 3.6.0.  Are there any other
> suggestions?  Is there a plan to correct this as I have not had this problem in
> any previous versions of Eclipse?

After some further reading I pulled Eclipse out of a directory with spaces in the name.  This seemed to resolve my issue along with adding the -vm option to the eclipse.ini file.

Still hoping there will be a fix that is applied so I don't have to edit the config file every time a new version of Java is installed.
Comment 46 Tamas Kis CLA 2010-10-12 06:00:42 EDT
Well, i experience a pretty similar problem "Eclipse icon is duplicated in taskbar" under:
 * K-Ubuntu Lucid (Ubuntu 4.4.3-4ubuntu5)
 * Platform 64 bit
 * JDK 1.6.0_20
 * Version: Helios Release  Build id: 20100617-1415

There are two windows displayed in case some views are dragged out of the main application frame.

Regards
Tamas
Comment 47 Fionn CLA 2010-10-14 03:26:56 EDT
Same issue for Win7 64bit - Version: Helios Service Release 1

Downloaded jdk 6 u22 64bit, added -vm option on the first line and it worked for me.
Comment 48 Aaron Kelley CLA 2010-11-04 07:27:35 EDT
Tried the -vm option discussed here and couldn't get it to work.  Worked around this issue by putting "C:\Program Files\Java\jdk1.6.0_22\bin" FIRST in the system PATH variable.  (I think the important part is that it comes before Windows\system32 in the path.  Before, I had it in my user PATH variable instead of the system one, which wasn't good enough.)

This seemed to make Eclipse use the jvm.dll included with the JDK rather than javaw.exe in the Windows\system32 folder.  Then, I was able to pin Eclipse to the taskbar after I had selected a workspace, and I have a taskbar icon that behaves as it should.

Just gotta remember to update the PATH variable whenever a new version of the JDK comes along...
Comment 49 Felipe Heidrich CLA 2010-11-04 11:18:38 EDT
I have being following this bug for quite some time.
Is there anything we can do in SWT or in the launcher that would solve or simplify this problem ?

At this point I think the only thing I can do is to write up a FAQ item and close this bug point to the FAQ.

Any suggestions ?
Comment 50 Aaron Kelley CLA 2010-11-04 16:55:33 EDT
Would it be possible to discourage Eclipse from running under javaw.exe?  Are there any advantages to running under javaw.exe, or is it simply a fallback when it can't find a suitable jvm.dll?

Seems like if the Eclipse launcher were to check the entire PATH for a JVM directory before falling back to javaw.exe (and maybe even check other obvious places like default JDK/JRE installation paths), that would solve this problem.  However, that is looking at this problem alone, I don't know what else this change in behavior would affect.

However, if there aren't any particular advantages to using javaw.exe as the VM, then this bug here seems like a good reason to avoid doing so when possible.
Comment 51 Russell Davis CLA 2010-11-15 18:56:05 EST
A note for others trying the workarounds on this page. I tried the -vm fix and the PATH fix, to no avail. But, after restarting windows (full reboot - a simple logoff/login wasn't enough), it finally worked. I suspect Windows has some sort of caching bug with taskbar shortcuts.
Comment 52 Graeme Bryce CLA 2010-11-26 04:52:11 EST
I would like to confirm that a reboot is a necessary part of the process.

I think a number of the solutions actually work, adding the -vm with path on the next line OR changing the order of the windows path environment variable such that an up-to-date JRE bin folder is present ahead of the windows\system32 folder.

But I had tried all of these in various combinations but always had two icons etc.

The fix for me was

1. remove the item form the taskbar
2. perform a full restart
3. navigate to the folder (which in my case DOES have spaces) where eclipse.exe exists
4. right click and add to taskbar.

It just worked :-)  but it had not worked for months and I had visited this and other forums several times looking for the fix.

Why? - I have no idea, something is being cached.

To include a re-boot for something as trivial as this takes me back 20 years!
Comment 54 Vladimir Nicolici CLA 2011-01-04 13:27:40 EST
Fixed the problem after adding the -vm parameter to eclipse.ini.

IMO, what Eclipse needs is a an installer, that will allow you to select the desired JDK from the list of JDKs installed on the system, and automatically update the eclipse.ini file. It would also be nice if that installer integrated with the operating system programs database, and also allowed uninstall from the "Programs and Features" control panel.

Either that, or at least give a warning after starting up if the -vm parameter is not set. It's not normal to need to look in a bug database to be able to install Eclipse. Especially since the bug is more than 6 month old.
Comment 55 Cory Lappi CLA 2011-01-04 14:15:11 EST
"IMO, what Eclipse needs is a an installer, that will allow you to select the
desired JDK from the list of JDKs installed on the system, and automatically
update the eclipse.ini file."

I really really really like the fact Eclipse does not have an installer. However, perhaps the above feature could be implemented in a check on Eclipse startup. That would be a great feature.
Comment 56 mukundan desikan CLA 2011-02-18 17:00:34 EST
Any possibility that this will be fixed for SWT layer? as we are seeing this problem in all eclipse based Lotus products.
Comment 57 Felipe Heidrich CLA 2011-02-22 11:25:00 EST
(In reply to comment #56)
> Any possibility that this will be fixed for SWT layer? as we are seeing this
> problem in all eclipse based Lotus products.

Can this problem be fixed in SWT ? I don't think it can.
Maybe the launcher can fix this problem.
Comment 58 mukundan desikan CLA 2011-03-09 15:25:22 EST
We (Lotus) are noticing this problem with since we upgraded to SWT3.6.1 end of last year in all these platforms

MS Windows 7 Professional 32-bit, MS Windows 7 Professional 64-bit, MS Windows 7 Enterprise 32-bit, MS Windows 7 Enterprise 64-bit, MS Windows 7 Ultimate 32-bit, MS Windows 7 Ultimate 64-bit

(In reply to comment #57)

> Can this problem be fixed in SWT ? I don't think it can.
> Maybe the launcher can fix this problem.

If not SWT bug, can  you please let us know if this be fixed in launcher anytime soon?
Comment 59 mukundan desikan CLA 2011-03-09 17:11:03 EST
This problem seems to be happening with Eclipse 342 as well on windows 7
Comment 60 Spyrus CLA 2011-03-10 05:50:14 EST
Confirm bug is still here with Helios SR2
Comment 61 David Ignjic CLA 2011-03-24 06:40:08 EDT
Probably i have solution. I have two eclipse one can be pinned and second not after added to eclipse.ini -vm parameter. you need change right to ecilpse.exe allow full for every one or users. For me this help me. Or simply try run as administrator and check if you can pin and after that change rigths and unselect run as administrator.
Comment 62 elhanan Maayan CLA 2011-03-30 01:24:04 EDT
i've was able to avoid this by using javaw.exe and not the jvm.dll
Comment 63 Simon Sheehan CLA 2011-04-23 23:07:46 EDT
I have had this issue since I began using Galilaeo I believe. I also run on Windows 7. 


It's not a major issue, but it would be great to see it fixed
Comment 64 wmac CLA 2011-08-18 06:18:14 EDT
This bug still exists in indigo.

If Eclipse is pinned to task bar, if you run it, you will have two icons.
Comment 65 Marcin Wisnicki CLA 2011-09-09 12:40:00 EDT
For everyone experiencing this:

1. Unpin Eclipse
2. Clean %APPDATA%\Microsoft\Windows\Recent\AutomaticDestinations (at least files containing reference to eclipse).
3. In eclipse.ini set vm to jvm\bin directory

Above resolved this problem for me on Win7/x64 with both 32 and 64 bit Eclipse 3.7.
Comment 66 Marcin Wisnicki CLA 2011-09-09 12:41:19 EDT
(In reply to comment #65)
> 1. Unpin Eclipse
> 2. Clean %APPDATA%\Microsoft\Windows\Recent\AutomaticDestinations (at least
> files containing reference to eclipse).
> 3. In eclipse.ini set vm to jvm\bin directory

4. Start Eclipse and Pin it again.
Comment 67 Timo Kinnunen CLA 2011-10-22 16:31:37 EDT
Tested with 3 Eclipse installations running at the same time: my regular Indigo, a fresh Galileo (eclipse-java-galileo-SR2-win32.zip), a fresh Helios (eclipse-java-helios-win32.zip). Windows 7 64-bit, Java SE JRE 32-bit version 1.6.0_29-b11.

Setup:
0. Pin Indigo, Galileo and Helios to Taskbar by right-clicking each eclipse.exe, then selecting Pin to Taskbar.

Steps:
1. Click Indigo's icon. The icon activates, shows a progress bar, then deactivates when a new active icon is added to the Taskbar when the workbench is displayed.
2. Click Helios' icon. As above, except the new active icon is combined with the icon Indigo added.
3. Click Galileo's icon. The icon activates, then stays active, as expected. Aero Peek shows the splash screen and workbench side-by-side briefly when the workbench launches.

Workarounds that pin a running Eclipse instance icon to Taskbar don't prevent another Eclipse installation from combining its running icon with the pinned icon. Arguably the workaround in this case makes the situation worse; it's no longer possible to tell at a glance which Eclipse is running if both use the same icon.
Comment 68 Thomas Thuem CLA 2011-11-19 07:21:29 EST
This ticket is 1,5 years old and not yet fixed?!?

I experienced this problem with Eclipse 3.6 and 3.7. As the additional icon shows entries like "New Task..." and "Activate Task..." I thought it may be a problem with Mylyn. Indeed, I downloaded and installed Eclipse Classic (which is the only version without Mylyn) and IT WORKS!

Hence, I'm pretty sure this is an issue with Mylyn.

Still, I'm scared that this bug exists since 1,5 years...
Comment 69 Vladimir Nicolici CLA 2011-11-29 06:53:16 EST
Pinning still doesn't work properly with Indigo J2EE Service Release 1, on Windows 8 Developer Preview x64 [Version 6.2.8102], and JRockit x64 jdk1.6.0_29-R28.1.5-4.0.1.

No configuration editing, I just installed JRockit and extracted the eclipse-jee-indigo-SR1-win32-x86_64.zip archive.

I start Eclipse by running eclipse.exe, I pin it to the taskbar by right-click on the task bar -> pin this program to the taskbar, then close Eclipse.

The pinned shortcut points to Java(TM) Platform SE binary (C:\Windows\System32\javaw.exe), and clicking it just starts a javaw process that closes immediately due to no command line parameters.
Comment 70 Vincent Freeman CLA 2011-11-29 13:20:11 EST
Well, there's definitely a working workaround because I somehow got it working on my computer(I remember having this issue, not the solution though), but I have now tried every method in this ticket, as well as spending several hours searching the web. :(

:'(
Comment 71 Vladimir Nicolici CLA 2011-11-29 13:24:45 EST
I fixed it by adding 

-vm
c:\Program Files\Java\jrockit-jdk1.6.0_29-R28.1.5-4.0.1\jre\bin\jrockit\jvm.dll

at the top of the eclipse.ini file before pinning.
Comment 72 Sam Skuce CLA 2011-12-06 11:11:16 EST
(In reply to comment #71)
> I fixed it by adding 
> 
> -vm
> c:\Program Files\Java\jrockit-jdk1.6.0_29-R28.1.5-4.0.1\jre\bin\jrockit\jvm.dll
> 
> at the top of the eclipse.ini file before pinning.

This worked for me as well, except I'm using a "vanilla" hotbox jre on my x64 system, so I used 
-vm
C:\Program Files\Java\jre6\bin

At the top of my .ini file

It seems that if I just type in "java" at the command line, it uses the java.exe in c:\Windows\System32 rather than the one in Program Files, so I guess that has something to do with it.  You wouldn't think this would matter, since the Java installation copies its own files to the System32 directory.
Comment 73 Krzysztof Weso&#322;owski CLA 2012-01-01 16:14:04 EST
With Eclipse Indigo (standard CDT install) 32bit on Wind7 32bit extra icon was created, hovewer it can be pinned, so after removinf default one we have one single icon.

On 64bit Eclipse and Win7 64bit second icon is not "pinnable", and process running eclipse is javaw.exe.
Comment 74 Frank Hoffmann CLA 2012-02-07 03:01:57 EST
I wor
Comment 75 Alec Doughty CLA 2012-03-10 20:33:46 EST
Hi,
I was having the same issue with Eclipse-PHP running on 64bit Windows 8 Consumer Preview.

What worked for me:

1. Edit eclipse.ini
2. Add at top of ini:  -vm C:\Program Files (x86)\Java\jre6\bin
(-vm should be on line 1 with the {PATH} on line 2)
3. Moved the Eclipse install folder to C:\Eclipse-PHP
4. Reboot
5. Run Eclipse
6. Once Eclipse has fully loaded, right-click on icon in Taskbar and "Pin to taskbar"

The reboot is important. I was unable to bring up the "Pin to Taskbar" option when right-clicking the taskbar icon when Eclipse was running. After the reboot, everything was golden.
Comment 76 Robert K. CLA 2012-06-13 11:55:46 EDT
Summarizing this bug we have:

1. The default method of Eclipse by just starting a second process of javaw.exe is a bad decision on Windows 64 (amd64) platform.

2. Using the jvm.dll via JNI instead does not have any disadvantages (independent if we are running on 32bit or 64bit Windows system).

3. At the moment for using the jvm.dll you have to explicitly set the directory or the complete file path in eclipse.ini. Every time the path changes you have to adapt that.

Conclusion: The best way would be to change Eclipse.exe to detect all installed JVM and automatically select one. As far as I remember the Launch4J project already has some sophisticated code for detecting installed JVMs. That code my be reused for Eclipse launcher.

In the end one could use eclipse.ini just for configuring if Eclipse should prefer a JRE or a JDK installation - the rest is detected automatically.

That would provide a permanent solution of this nasty problem.
Comment 77 Vladimir Nicolici CLA 2012-06-13 16:15:15 EDT
"Using the jvm.dll via JNI instead does not have any disadvantages"

Actually, as soon as I start using jvm.dll eclipse crashes at the splash screen when restarting after installing updates/new features. Then I have to start it again, and it works fine.

This happens on Windows 7 and Windows 8 on the standard jdk and on jrockit.

Crash report from Windows:

Source
eclipse.exe

Summary
Stopped working

Date
‎2012-‎06-‎13 22:46

Status
Report sent

Description
Faulting Application Path:	C:\eclipse-jee-indigo-SR2-win32-x86_64\eclipse\eclipse.exe

Problem signature
Problem Event Name:	APPCRASH
Application Name:	eclipse.exe
Application Version:	0.0.0.0
Application Timestamp:	4d87ac10
Fault Module Name:	StackHash_3268
Fault Module Version:	6.2.8400.0
Fault Module Timestamp:	4fb7166c
Exception Code:	c0000374
Exception Offset:	PCH_C7_FROM_ntdll+0x0000000000002E2A
OS Version:	6.2.8400.2.0.0.256.48
Locale ID:	1033
Additional Information 1:	3268
Additional Information 2:	3268f8b3d0d59d3b72e4181ff0cc5c33
Additional Information 3:	4349
Additional Information 4:	4349bcda4d6af45df09c83e3880cd46a

Extra information about the problem
Bucket ID:	62c751a97ee35a96c348b88720658dcb (66625898)
Comment 78 Steffen Heil CLA 2012-07-27 07:50:05 EDT
While adding the "-vm" option to eclipse.ini worked for me with 3.7, it did not with 4.2. The ONLY way I found after lots of experiments was:

1. Add the following at the top of your eclipse.ini file (adjust the path):
   -vm
   C:/Program Files/Java/jre7/bin

2. Right click on eclipse.exe -> Properties -> Compatibility, 
   Enable compatibility mode with "Windows XP Service Pack 3" or "Windows Vista".

3. Run Eclipse.

4. Wait until the workspace is loaded.

5. Pin to the taskbar. 

6. Close Eclipse.

7. Removed compatibility settings from eclipse.exe.

8. Run Eclipse.

9. Unpin from taskbar and pin again.

Thanks to MarioVilas at http://stackoverflow.com/questions/5234626/how-to-make-eclipse-behave-well-in-the-windows-7-taskbar.
Comment 79 Mikhail Nemtsev CLA 2012-10-15 00:18:48 EDT
I did what "Steffen Heil 2012-07-27 07:50:05 EDT" said, but without changing any compatibility settings and it worked (see the link he provides). 

Under Windows Server 2012 x64, in the system PATH as the first(!) entry I put (without quotes) "C:\Program Files\Java\jdk1.7.0_07\bin\;" and after restarting the machine I started Eclipse (v4.2.1) and then was able to pin it to task bar. Now it runs without duplicating its icon.
Comment 80 AbdelHameed Mahmoud CLA 2012-11-07 06:34:23 EST
The workaround of pining a running version of Eclipse is working OK for me.
I am using eclipse-juno classic version
on WIN 7 Ultimate 32Bit

Abdo
Comment 81 Iain Hallam CLA 2012-11-12 06:11:27 EST
Netbeans had this problem, and it was related to using a 64-bit launcher; is that related? http://netbeans.org/bugzilla/show_bug.cgi?id=178273
Comment 82 AbdelHameed Mahmoud CLA 2013-01-17 11:26:25 EST
The workaround of Larry is working OK for me. Thanks.
(In reply to comment #40)
> I was able to pin eclipse to the taskbar on Win 7 x32 and x64 with the
> following lines in eclipse.ini:
> 
> -vm 
> c:\java\jdk1.6.0\bin
> 
> The "-vm" must be on a separate line, followed by the path to the java bin
> folder (just the "bin" folder, do not include javaw.exe!).
> I have placed these on the first two lines of the eclipse.ini file.
Comment 83 Vladimir Nicolici CLA 2013-01-27 13:24:59 EST
Still not working in Windows 8 Final x64.

And the workaround to start the VM with the DLL is not a good one.

It causes Eclipse to crash after switching the workspace or installing updates and restarting it :(
Comment 84 Vladimir Nicolici CLA 2013-01-27 13:48:13 EST
The bug id for the crashes on restart is 315009 .

You might want to vote for that too if you voted for this.
Comment 85 Ezekiel Fairfax CLA 2013-04-15 20:04:30 EDT
I got this working on Windows 8, 64-bit, by adding the following lines to the TOP of eclipse.ini

-vm 
C:\Program Files\Java\jre7\bin
Comment 86 Michael Konečný CLA 2013-12-18 10:56:32 EST
I confirm this behaviour on Windows 7 SP1 when running Eclipse from a shortcut created for eclipse.exe.

Also confirm that the workaround posted by Shawn Minto at 2010-05-31 13:59:05 EDT works for me (thanks).
Comment 87 Juan Carlos Peñuela CLA 2014-01-02 15:35:57 EST
Confirmed, the same issue in Win8.1 64 bits, but, with the line added to .ini as Ezekiel Fairfax said on 2013-04-15 20:04:30, it works. Run it and pin it, it uses the correct icon and the shortcut to new tasks in the icon work too.
Comment 88 leo android CLA 2014-01-13 07:21:19 EST
Running Win8.1, 64bit, J7.45

For me the trick with the ini-file did NOT work. 

It worked for me to launch Eclipse, then right-click on the icon in the taskbar ==> Pin to taskbar and that was it. Start-Stop work fine. 

I guess the additional icon-problem might be due to link-issue not properly resolved - but only as a GUESS.
Comment 89 Marcin Wisnicki CLA 2014-01-13 08:21:02 EST
To definitely fix this issue, Eclipse should establish application identity by calling SetCurrentProcessExplicitAppUserModelID[1] with an ID based on eclipse location.

1. http://msdn.microsoft.com/en-us/library/windows/desktop/dd378422%28v=vs.85%29.aspx
Comment 90 Timo Kinnunen CLA 2014-01-25 10:44:17 EST
I was surprised to find that class org.eclipse.swt.internal.win32.OS from plugin org.eclipse.swt.win32.win32.x86_64_3.102.1.v20130827-2048.jar already has the required function:
public static final native int SetCurrentProcessExplicitAppUserModelID (char[] AppID);

Quick test with a random SWT snippet shows it working and preventing multiple launched processes from being grouped. The remaining open issues are at least: 

1) The function has to be called before any UI is shown at all, that presumably includes the splash screen. Where is that created? And what is eclipse.exe's effect here?
2) To function properly, the generated AppUserModelID should be based on both the installation folder and workspace folder, a combination of their hash codes should be sufficient. Then there's a couple of cases:

case 1, workspace not chosen: not a problem, use a random number in its place.

case 2, workspace set and not in use: this is the normal case, no further action required.

case 3, workspace in use: workspace selection dialog and presumably the in-use-check happen after splash screen is displayed, this won't work. Either the check needs to be duplicated where the splash screen is created or moved to there.

How does one build and test eclipse.exe?
Comment 91 Timo Kinnunen CLA 2014-02-04 13:20:22 EST
Thanks to SetCurrentProcessExplicitAppUserModelID method being pointed out I've figured out what caused this regression so many years ago. It would've been weird for such win32 API method to be included and then not used anywhere, wouldn't it be? And it turns out it is called. The rest of the bug is all about Windows doing exactly what Eclipse asks it to do. 

The call was introduced to support jump lists in Windows 7, but the support for them was never polished and finished. See bug 293226 comment 9 for a starting point if you want to dig into the history. One change from that was to the SWT API Display.setAppName(String), which now controlled which application's jump lists other APIs refer to, as well as taskbar icon grouping. 

If you use SWT and don't call that API then SWT tells Windows your applications are all part of one big "SWT" application. 

Eclipse's default isn't any better. Both Standard and SDK distributions claim they are all part of one "Eclipse" application. It's no wonder every Eclipse installation gets lumped together!

One more thing. Shortcuts can contain a AppUserModelID as well, usually set during installation. Shortcuts created in Explorer don't have that. They are part of the user's files, not the application's, I guess. Calling SetCurrentProcessExplicitAppUserModelID with something else than what was in the shortcut changes the grouping and explains why the splash screen groups correctly with the taskbar icon but the workbench doesn't, no matter what. Knowing this, the only sane call that one can make without further information is calling Display.setAppName(null); Or Display.setAppName(""), apparently.

Armed with this knowledge it's now possible to devise a workaround:

1) Edit the plugin.xml file of your selected Eclipse version ("product") and erase the following line: 
<property name="appName" value="Eclipse"/> 

This should be done before starting the installation for the first time, because the property value gets cached and the change won't have effect before the cache is cleared. The correct file to edit varies: 
			eclipse-SDK-4.4M5-win32-x86_64 ------------------> \plugins\org.eclipse.sdk_4.4.0.v20140123-1600
			eclipse-standard-luna-M3-win32-x86_64 -----------> \plugins\org.eclipse.epp.package.standard_2.1.0.20131103-0830
			etc. 

2) 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

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.

3) Launch Eclipse by double-clicking eclipse.exe. Only once the workspace is open select "Pin this program to taskbar" from the taskbar icon. 

I now have 4 separate installations - each with its own icon - as a proof-of-concept and test. I've noticed that changing the properties of the shortcut once it's been created seems to break the grouping, but pinning it again carries over the changes from the old icon.
Comment 92 eddy gordo CLA 2014-04-08 11:51:34 EDT
Hi, just thought I'd share my solution.

Problem:
JRE8, Kepler, Win7 x64
Editing eclipse.ini to set VM does not work, eclipse won't launch (exit code=1). --Xint or --Xint or -XX:-UseCompressedOops doesn't work, running as admin doesn't work.

Solution:

1. Make a shortcut to eclipse.exe.
2. Edit that shortcut, adding -VM <path> to Target (in my case this becomes: "ecplise.exe -VM D:\Programs\Java\jre8\bin"
3. Use the shortcut to start Eclipse.
4. Once Eclipse is running (not just the splash), right-click and pin.
5. (optional) Safe to remove the shortcut.
Comment 93 Timo Kinnunen CLA 2014-04-08 15:59:38 EDT
(In reply to comment #92)
> Hi, just thought I'd share my solution.
> 
> Problem:
> JRE8, Kepler, Win7 x64
> Editing eclipse.ini to set VM does not work, eclipse won't launch (exit code=1).
> --Xint or --Xint or -XX:-UseCompressedOops doesn't work, running as admin
> doesn't work.
> 
> Solution:
> 
> 1. Make a shortcut to eclipse.exe.
> 2. Edit that shortcut, adding -VM <path> to Target (in my case this becomes:
> "ecplise.exe -VM D:\Programs\Java\jre8\bin"
> 3. Use the shortcut to start Eclipse.
> 4. Once Eclipse is running (not just the splash), right-click and pin.
> 5. (optional) Safe to remove the shortcut.

Hi, does your solution work if you create a copy of your Eclipse folder and pin (and run) both at the same time?
Comment 94 Arun Thondapu CLA 2014-04-11 09:32:42 EDT
Won't this bug get fixed via the fix described for bug 432435? Can this be marked as a duplicate then?
Comment 95 Timo Kinnunen CLA 2014-04-11 10:13:04 EDT
(In reply to comment #94)
> Won't this bug get fixed via the fix described for bug 432435? Can this be
> marked as a duplicate then?

Not exactly. There is SWT which by default uses AppModelUserID "SWT", but then there's also various Eclipse based products which use their own AppModelUserID "Eclipse", there's bug 432353 for that part. Both may need a resolution to fix this bug, depending on which one goes first and in what manner.
Comment 96 Jan Hurst CLA 2014-04-12 05:41:59 EDT
(In reply to eddy gordo from comment #92)
> Solution:
> 
> 1. Make a shortcut to eclipse.exe.
> 2. Edit that shortcut, adding -VM <path> to Target (in my case this becomes:
> "ecplise.exe -VM D:\Programs\Java\jre8\bin"
> 3. Use the shortcut to start Eclipse.
> 4. Once Eclipse is running (not just the splash), right-click and pin.
> 5. (optional) Safe to remove the shortcut.

This works for me on a Win2k8R2 server and Java 7 JRE.
-jan
Comment 97 Jan Hurst CLA 2014-04-12 05:42:35 EDT
(In reply to eddy gordo from comment #92)
> Solution:
> 
> 1. Make a shortcut to eclipse.exe.
> 2. Edit that shortcut, adding -VM <path> to Target (in my case this becomes:
> "ecplise.exe -VM D:\Programs\Java\jre8\bin"
> 3. Use the shortcut to start Eclipse.
> 4. Once Eclipse is running (not just the splash), right-click and pin.
> 5. (optional) Safe to remove the shortcut.

This works for me on a Win2k8R2 server and Java 7 JRE.
-jan
Comment 98 Timo Kinnunen CLA 2014-04-12 09:43:28 EDT
(In reply to comment #97)
> This works for me on a Win2k8R2 server and Java 7 JRE.

It "works" only as long as you never have another copy of Eclipse (like a new version, perhaps) on your computer. Or you never run this SWT Hello World program from Eclipse with its one-line addition:

public class AnotherEclipse {
	public static void main(String[] args) {
		org.eclipse.swt.internal.win32.OS.SetCurrentProcessExplicitAppUserModelID("Eclipse\0".toCharArray());
		org.eclipse.swt.widgets.Display display = new org.eclipse.swt.widgets.Display();
		org.eclipse.swt.widgets.Shell shell = new org.eclipse.swt.widgets.Shell(display);
		shell.open();
		while(!shell.isDisposed()) {
			if(!display.readAndDispatch()) {
				display.sleep();
			}
		}
		display.dispose();
	}
}
Comment 99 Dave Druckenmiller CLA 2014-04-28 11:29:33 EDT
None of the workarounds mentioned in this issue are working for me for Kepler. When I add the -VM flag to either the shortcut or eclipse.ini, Eclipse starts but the taskbar icon has no right-click context menu whatsoever (i.e. right-click and nothing happens). Without the -VM flag, I get the minimal context menu when I right-click that just has "New Task" and "Activate Task" options.

My configuration:

Windows 7 Professional 64-bit
JRE 7u55 64-bit
Eclipse Kepler C/C++ 64-bit

I was running 32-bit Eclipse Juno C/C++ with JRE 7u51 32-bit until this morning. I renamed all previous Eclipse-related directories (except those in AppData) so that it would be starting fresh (or so I had hoped).
Comment 100 Yee Keat Phuah CLA 2014-05-08 04:29:12 EDT
(In reply to eddy gordo from comment #92)
> 1. Make a shortcut to eclipse.exe.
> 2. Edit that shortcut, adding -VM <path> to Target (in my case this becomes:
> "ecplise.exe -VM D:\Programs\Java\jre8\bin"
> 3. Use the shortcut to start Eclipse.
> 4. Once Eclipse is running (not just the splash), right-click and pin.
> 5. (optional) Safe to remove the shortcut.

Worked for me with Kepler, Windows 8.1, Java 7.
Comment 101 Benjamin Cooper CLA 2014-08-30 21:22:11 EDT
(In reply to Timo Kinnunen from comment #91)
> Thanks to SetCurrentProcessExplicitAppUserModelID method being pointed out
> I've figured out what caused this regression so many years ago. It would've
> been weird for such win32 API method to be included and then not used
> anywhere, wouldn't it be? And it turns out it is called. The rest of the bug
> is all about Windows doing exactly what Eclipse asks it to do. 
> 
> The call was introduced to support jump lists in Windows 7, but the support
> for them was never polished and finished. See bug 293226 comment 9 for a
> starting point if you want to dig into the history. One change from that was
> to the SWT API Display.setAppName(String), which now controlled which
> application's jump lists other APIs refer to, as well as taskbar icon
> grouping. 
> 
> If you use SWT and don't call that API then SWT tells Windows your
> applications are all part of one big "SWT" application. 
> 
> Eclipse's default isn't any better. Both Standard and SDK distributions
> claim they are all part of one "Eclipse" application. It's no wonder every
> Eclipse installation gets lumped together!
> 
> One more thing. Shortcuts can contain a AppUserModelID as well, usually set
> during installation. Shortcuts created in Explorer don't have that. They are
> part of the user's files, not the application's, I guess. Calling
> SetCurrentProcessExplicitAppUserModelID with something else than what was in
> the shortcut changes the grouping and explains why the splash screen groups
> correctly with the taskbar icon but the workbench doesn't, no matter what.
> Knowing this, the only sane call that one can make without further
> information is calling Display.setAppName(null); Or Display.setAppName(""),
> apparently.
> 
> Armed with this knowledge it's now possible to devise a workaround:
> 
> 1) Edit the plugin.xml file of your selected Eclipse version ("product") and
> erase the following line: 
> <property name="appName" value="Eclipse"/> 
> 
> This should be done before starting the installation for the first time,
> because the property value gets cached and the change won't have effect
> before the cache is cleared. The correct file to edit varies: 
> 			eclipse-SDK-4.4M5-win32-x86_64 ------------------>
> \plugins\org.eclipse.sdk_4.4.0.v20140123-1600
> 			eclipse-standard-luna-M3-win32-x86_64 ----------->
> \plugins\org.eclipse.epp.package.standard_2.1.0.20131103-0830
> 			etc. 
> 
> 2) 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
> 
> 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.
> 
> 3) Launch Eclipse by double-clicking eclipse.exe. Only once the workspace is
> open select "Pin this program to taskbar" from the taskbar icon. 
> 
> I now have 4 separate installations - each with its own icon - as a
> proof-of-concept and test. I've noticed that changing the properties of the
> shortcut once it's been created seems to break the grouping, but pinning it
> again carries over the changes from the old icon.

Hello guys, this is my first post and English is not my native language, please be lenient. Dear Timo I edited my eclipse.ini and added the path to jvm.dll correctly and I confirm that I have no longer a duplicated icon on my taskbar (I'm using Windows 8.1 Pro x64), but there is one more thing I would love to change and that is the name of the pinned shortcut which in my situation is "eclipse" (without the quotes). I think that you are explaining why is that happening in your post, but I honestly don't understand much. Though I edited the appropriate plugin.xml, erased the line you suggested and launched eclipse with the -clean argument to clean the cache, but nothing happened, the name is still that irritating "eclipse".
Comment 102 Benjamin Cooper CLA 2014-08-30 22:14:36 EDT
Okay, the bad news is that I got again the duplicate icon. The good news is that I fixed it and I found a way to name my shortcut without getting it duplicated.

1) Remove the path to jvm.dll from eclipse.ini.

2) Add the path to jvm.dll by editing your eclipse shotcut.

3) Navigate to "C:\Users\%USERNAME%\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar".

4) Rename the eclipse shortcut.

Good luck!
Comment 103 Jason Cheung CLA 2015-03-24 19:29:27 EDT
This removed the duplicate taskbar icon for me:

1. Unpin eclipse from the taskbar
2. Launch eclipse using the eclipse.exe
3. When eclipse has finished loading, right-click eclipse in the taskbar and pin it.

From then on, when you open eclipse, it will not duplicate the icon in the taskbar.
This works for me on Windows 8.1 Pro 64-bit with the 64-bit version of eclipse Luna.
Comment 104 Tim Buschtoens CLA 2015-07-02 04:56:04 EDT
The hacks described here used to fix the issues for me, but in Mars it came back with a vengeance. Now, no matter what VM I use:

- the instance always has a separate icon from the eclipse.exe I pinned
- the instance has that default application icon, not the eclipse.exe icon
- the instance icon can not be pinned, but it has the "New Task"/"Activate Task" context menu

Windows 8.1/64
Comment 105 Nobody - feel free to take it CLA 2015-07-02 06:56:52 EDT
The hack has been working equally well after upgrading to Mars for me.
Comment 106 Niraj Modi CLA 2015-07-03 09:14:24 EDT
Eclipse workspace process uses "Eclipse" as 'appname' for the OS level process. This information <property name="appName" value="Eclipse"/> is read from below file: <ECLIPSE_ROOT>\plugins\org.eclipse.sdk_4.5.0.v20150603-2000\plugin.xml

Currently the launcher process i.e. eclipse.exe doesn't set any 'appname' to itself before launching the workspace process.

Proposed fix: Set appropriate 'appname' in launcher code so that the workspace process get's group with launcher process.
Comment 107 Ruslan Gainutdinov CLA 2015-07-06 05:17:26 EDT
Here is that worked for me (including fixing problems pinning as noted in Comment 104 and running 2 instances of Eclipse without grouping)

1. Remove all icons from taskbar (unpin) and close.

2. Go to eclipse and search for plugin.xml with content appName

3. In property definition change <property from name="appName" value="Eclipse">
to something like <property from name="appName" value="Eclipse123">

4. Add JVM as DLL so eclipse.exe will be single process without javaw.exe
Add -vm <path to JDK...>/jre/bin/server/jvm.dll to eclipse.ini

5. Run with eclipse.exe -clean to clean cache and reread property from plugin.xml. DO NOT PIN!

6. Close and run again WITHOUT -clean argument

7. Pin using right click menu.

You can now start it from taskbar.
Comment 108 Vladimir Nicolici CLA 2015-07-06 08:44:22 EDT
Something seems to have changed in Windows 10 in the last few builds, in the past pinning with a DLL VM worked fine for me, no duplication. Now it duplicates.

And the 7 step solution didn't work for me.

I found 4 plugin.xml files, and I modified appName in all of them from Eclipse to ScalaIDE, ran with -clean, restarted and pinned it, still duplicates the icon.

That could be a Windows 10 bug, because for example pinning Chrome app shortcuts doesn't work at all and the issues started on the same Windows 10 build. I'm now on build 10162.
Comment 109 Henrik Heimbuerger CLA 2015-07-07 04:01:52 EDT
I'm also pretty sure something changed in the last two fast ring builds of Windows 10. I'm not using Eclipse right now, but I've had multiple apps start to show this behavior, including SmartGit (which I know for sure is an RCP app), PyCharm and Skype.
Comment 110 Niraj Modi CLA 2015-07-09 10:02:01 EDT
(In reply to Vladimir Nicolici from comment #108)
> Something seems to have changed in Windows 10 in the last few builds, in the
> past pinning with a DLL VM worked fine for me, no duplication. Now it
> duplicates.
> 
> And the 7 step solution didn't work for me.
> 
> I found 4 plugin.xml files, and I modified appName in all of them from
> Eclipse to ScalaIDE, ran with -clean, restarted and pinned it, still
> duplicates the icon.
> 
> That could be a Windows 10 bug, because for example pinning Chrome app
> shortcuts doesn't work at all and the issues started on the same Windows 10
> build. I'm now on build 10162.

I don't face this problem on Win10 VM build 10074, it seems a issue with the recent win10 builds.

(In reply to Henrik Heimbuerger from comment #109)
> I'm also pretty sure something changed in the last two fast ring builds of
> Windows 10. I'm not using Eclipse right now, but I've had multiple apps
> start to show this behavior, including SmartGit (which I know for sure is an
> RCP app), PyCharm and Skype.

Vladimir/Henrik:
Suggest you to report this issue to Microsoft, there's a "windows feedback" app per-installed on Win10 machine itself, refer below blog on how to report a bug, Thanks!
http://www.techulator.com/resources/13419-How-to-report-Windows-10-bugs-to-Microsoft.aspx
Comment 111 Henrik Heimbuerger CLA 2015-07-09 10:51:06 EDT
(In reply to Niraj Modi from comment #110)
> (In reply to Vladimir Nicolici from comment #108)
> > That could be a Windows 10 bug, because for example pinning Chrome app
> > shortcuts doesn't work at all and the issues started on the same Windows 10
> > build. I'm now on build 10162.
> 
> I don't face this problem on Win10 VM build 10074, it seems a issue with the
> recent win10 builds.

Correct, it appeared recently. Still working in 10074 sounds about right, it might have appeared in roughly >10100.

> (In reply to Henrik Heimbuerger from comment #109)
> > I'm also pretty sure something changed in the last two fast ring builds of
> > Windows 10. I'm not using Eclipse right now, but I've had multiple apps
> > start to show this behavior, including SmartGit (which I know for sure is an
> > RCP app), PyCharm and Skype.
> 
> Vladimir/Henrik:
> Suggest you to report this issue to Microsoft, there's a "windows feedback"
> app per-installed on Win10 machine itself, refer below blog on how to report
> a bug, Thanks!
> http://www.techulator.com/resources/13419-How-to-report-Windows-10-bugs-to-
> Microsoft.aspx

Yeah, I've reported many bugs with this app and have also reported this specific issue when it first occured about a month ago. But you know how these programs go, I'm not even entirely sure anyone is reading those reports (plus they must get thousands, probably more than they possibly can sift through).
Comment 112 Johan Compagner CLA 2015-08-25 11:04:29 EDT
so it really seems to be impossible to pin eclipse anymore to the taksbar in the final of windows 10?

I tried also pretty much everything i could find (also adjusting the path of windows). Nothing helps, it always duplicates

For me eclipse is the only application that behaves that way (chrome apps for example work fine for me)
Comment 113 Niraj Modi CLA 2015-09-08 03:12:02 EDT
(In reply to Timo Kinnunen from comment #91)
> Thanks to SetCurrentProcessExplicitAppUserModelID method being pointed out

Couple of per-requisite to use of "SetCurrentProcessExplicitAppUserModelID":
- This API in introduced with Win7 SDK and requires Visual Studio 2010 compilers.
- To run an executable built using Visual Studio 2010, "Visual Studio 2010 Runtime" is required on every machine, precisely "msvcr100.dll" dll is required(Note:- Some application do ship this dll along with their products)
[What it means, to run Eclipse on any Windows7 machine VS 2010 run-time needs to be installed.]

Say, going with above per-requisites in place.. continued investigating this issue:
- I tried to set appropriate application which is "Eclipse" in eclipse launcher process so that both eclipse workspace(which is a jvm process) and launcher(which is eclispe.exe process) both gets same AppUserModelID.
- Also launcher build infrastructure is upgraded to use win7 SDK and VS 2010.

But the results are not satisfactory, icons still get duplicated.
All in all what is achieved is launcher process and workspace process do get grouped together, but it doesn't get grouped with the existing icon already pinned on the task-bar using and leads to duplication.

Anyway, will share a launcher gerrit patch on above investigation to seek opinion/input from community.
Comment 114 Eclipse Genie CLA 2015-09-08 03:14:15 EDT
New Gerrit change created: https://git.eclipse.org/r/55435
Comment 115 Niraj Modi CLA 2015-09-11 13:07:39 EDT
Explored an alternate approach to programmatically manipulate Taskbar so as to remove an exiting pinned eclipse launcher process and explicitly pin eclipse workspace process... so as to get rid of duplicate icon.

Sharing my investigation on this:
- As per MSDN programmatically pinning of application is not permitted Win7 onwards.
Copying lines the MSDN article: "A small set of applications are pinned by default for new installations. Other than these, only the user can pin further applications; programmatic pinning by an application is not permitted."
For more details refer below article:
https://msdn.microsoft.com/en-us/library/windows/desktop/dd378460%28v=vs.85%29.aspx#unified
Comment 116 Steffen Heil CLA 2015-09-12 02:20:50 EDT
Is programmatically pinning of application is not possible or just not permitted?

I would assume that this rule targets applications that flood the taskbar (malware, scam), not applications repairing user-pinned broken links...
Comment 117 Patrick Scott CLA 2015-09-23 14:49:25 EDT
So (In reply to Niraj Modi from comment #113)
> (In reply to Timo Kinnunen from comment #91)
> > Thanks to SetCurrentProcessExplicitAppUserModelID method being pointed out
> 
> Couple of per-requisite to use of "SetCurrentProcessExplicitAppUserModelID":
> - This API in introduced with Win7 SDK and requires Visual Studio 2010
> compilers.
> - To run an executable built using Visual Studio 2010, "Visual Studio 2010
> Runtime" is required on every machine, precisely "msvcr100.dll" dll is
> required(Note:- Some application do ship this dll along with their products)
> [What it means, to run Eclipse on any Windows7 machine VS 2010 run-time
> needs to be installed.]
> 
> Say, going with above per-requisites in place.. continued investigating this
> issue:
> - I tried to set appropriate application which is "Eclipse" in eclipse
> launcher process so that both eclipse workspace(which is a jvm process) and
> launcher(which is eclispe.exe process) both gets same AppUserModelID.
> - Also launcher build infrastructure is upgraded to use win7 SDK and VS 2010.
> 
> But the results are not satisfactory, icons still get duplicated.
> All in all what is achieved is launcher process and workspace process do get
> grouped together, but it doesn't get grouped with the existing icon already
> pinned on the task-bar using and leads to duplication.
> 
> Anyway, will share a launcher gerrit patch on above investigation to seek
> opinion/input from community.

For what its worth, a microsoft developer on this stackoverflow question pointed out that the AppUserModelId flag is the way to go. 

http://stackoverflow.com/questions/32728018/how-to-make-eclipse-behave-well-in-the-windows-10-taskbar-and-program-search

Too bad you had no luck this far, no workarounds seem to work on windows 10
Comment 118 Patrick Scott CLA 2015-09-23 14:58:17 EDT
Sorry for the spam - wanted to paste in a snippet from the useful link posted stackoverdlow:

"Bonus chatter: If you create a shortcut to the application, you should also assign the custom Application User Model ID to the shortcut. That way, if the user calls up the jump list for the shortcut, they get the jump list for the correct Application User Model ID."

Source: http://blogs.msdn.com/b/oldnewthing/archive/2015/08/10/10634022.aspx

This might be the missing link (pun-intended) from efforts documented in comment 91 https://bugs.eclipse.org/bugs/show_bug.cgi?id=314805#c91
Comment 119 Thomas Singer CLA 2015-10-05 10:27:06 EDT
We have got pinning our SWT-based application's icon working with Windows 7 - 8.1. Unfortunately, this broke with Windows 10.
Comment 120 Vladimir Nicolici CLA 2015-10-13 05:29:08 EDT
Microsoft fixed the issue in the latest Windows 10 Insider Preview build (10565). According to the release notes:

"◾Certain apps won’t appear twice anymore when pinned to the taskbar."

I unpinned Eclipse and pinned it again, and now it no longer duplicates the icon.

I use -vm and the jvm DLL in my config:

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

So now we are probably back to the old behavior from Windows 8.
Comment 121 Moshe Katz CLA 2015-11-14 21:09:19 EST
I just installed the new release build from Windows Update, which is 10586, and can confirm that this is now fixed.

However, you MUST unpin and repin the icon in order to have it work properly.
Comment 122 Thomas Singer CLA 2015-12-02 10:25:38 EST
IMHO this issue can be closed.
Comment 123 Anton Meller CLA 2015-12-07 05:09:31 EST
But you still can't pin eclipse.exe (respectively it doesn't work as axpected) - not so important.
And you can't pin two different eclipse versions or installations without modifying plugin.xml because of "<property name="appName" value="Eclipse"/>" entry - much more important, at least for me.
Comment 124 Max Burns CLA 2015-12-07 12:46:41 EST
(In reply to Anton Meller from comment #123)
> But you still can't pin eclipse.exe (respectively it doesn't work as
> axpected) - not so important.
> And you can't pin two different eclipse versions or installations without
> modifying plugin.xml because of "<property name="appName" value="Eclipse"/>"
> entry - much more important, at least for me.

Then open a new bug and stop spamming everyone.
Comment 125 Anton Meller CLA 2015-12-08 02:15:52 EST
(In reply to Max Burns from comment #124)
> (In reply to Anton Meller from comment #123)
> > But you still can't pin eclipse.exe (respectively it doesn't work as
> > axpected) - not so important.
> > And you can't pin two different eclipse versions or installations without
> > modifying plugin.xml because of "<property name="appName" value="Eclipse"/>"
> > entry - much more important, at least for me.
> 
> Then open a new bug and stop spamming everyone.

Sorry, but it was discussed here since one and a half year (comment 91 and later) and now with my first comment here I am spamming everyone? How that?
Comment 126 Niraj Modi CLA 2016-05-26 02:22:02 EDT
Moving out of Neon.
Comment 127 Niraj Modi CLA 2017-05-25 08:11:33 EDT
Summarizing the approach taken to fix this bug:
Launching Eclipse is a two step process, launcher process(with no AppUserModelID) and work-space process with ('Eclipse' AppUserModelID) is causing this duplicate icon problem.

Tried an approach so both the above processes get to use same AppUserModelID i.e. 'Eclipse', but the results were not satisfactory see comment 113
We are currently stuck at this point.
Comment 128 Mark Ri CLA 2017-07-31 14:49:54 EDT
It seems that with the newest eclipse (Oxygen) I am no longer able to perform the fix where I would launch eclipse and wait for it to boot up before I pin the icon. I am unable to pin the icon because the option doesn't show up - If I right click it just shows me a preview of the application.
Comment 129 Mark Ri CLA 2017-07-31 15:12:44 EDT
(In reply to Mark Ri from comment #128)
> It seems that with the newest eclipse (Oxygen) I am no longer able to
> perform the fix where I would launch eclipse and wait for it to boot up
> before I pin the icon. I am unable to pin the icon because the option
> doesn't show up - If I right click it just shows me a preview of the
> application.

Scratch that. Rebooting solved the issue. I don't recall having to reboot in the past but that's not important.
Comment 130 Thomas Watson CLA 2018-05-07 12:19:29 EDT
(In reply to Niraj Modi from comment #127)
> Summarizing the approach taken to fix this bug:
> Launching Eclipse is a two step process, launcher process(with no
> AppUserModelID) and work-space process with ('Eclipse' AppUserModelID) is
> causing this duplicate icon problem.
> 
> Tried an approach so both the above processes get to use same AppUserModelID
> i.e. 'Eclipse', but the results were not satisfactory see comment 113
> We are currently stuck at this point.

I don't think any progress has been made since this comment.  I'm dropping the milestone.  Please reassign if/when you think this can be addressed.
Comment 131 Eclipse Genie CLA 2020-04-27 12:55:24 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 132 Missing name CLA 2020-05-01 13:40:06 EDT
(In reply to Eclipse Genie from comment #131)
> This bug hasn't ...
> The automated Eclipse Genie.

The bug is still there.
Comment 133 Alexandre Boutinaud CLA 2020-11-08 16:07:22 EST
Bug always there ! Pls fixe it.

Note that the second icon is a little bit blurry.