How to make Eclipse behave well in the Windows 7 taskbar?
Asked Answered
R

7

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.

Redtop answered 8/3, 2011 at 15:37 Comment(1)
I found that if I drag eclipse.exe from windows explorer onto the taskbar it allows me to pin it too.Mesolithic
S
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.

Sinkhole answered 14/3, 2011 at 15:22 Comment(12)
See Bug 314805: 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/binDibbuk
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).Winwaloe
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...Monadnock
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...Wellgroomed
Hehe, @Monadnock 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?Psoriasis
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.Undulate
Second solution worked for me too. Thank you. I had been dragging that annoying little issue for ages.Unfair
Unfortunately, this seems like it'll break when I upgrade JavaEggshell
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 behavesJumbo
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.Grolier
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.Transponder
I made the change above and it broke my eclipse ... so this is not the right solution.Clannish
T
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
Tonjatonjes answered 7/6, 2012 at 23:34 Comment(2)
Tried everything on this thread - this was what worked for me. Unpinning then re-pinnig was the key.Aseity
The key was using the directory path to the JDK bin, and not to the executable. Thanks.Decollate
T
15

setting eclipse.exe to compatibility mode works

Two answered 27/4, 2011 at 2:24 Comment(4)
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! +10000000Doxy
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.Gottschalk
This works in Windows 7 by setting compatibilty mode to Windows Vista.Isogloss
With Eclipse Mars it has unfortunate side effect of crashing EGitEncy
W
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.

Waal answered 15/9, 2015 at 10:47 Comment(0)
M
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.

Megmega answered 25/7, 2012 at 8:52 Comment(0)
B
3

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

Bangtail answered 13/2, 2017 at 20:46 Comment(1)
Very in-depths answer, thanks. The System.AppUserModel.ID explanation is what I was looking for for quite some time!Aec
M
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 !!!

Mycology answered 8/3, 2011 at 15:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.