如何使 Eclipse 在 Windows 7 任务栏中表现良好?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5234626/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to make Eclipse behave well in the Windows 7 taskbar?
提问by Jader Dias
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.
可以固定到任务栏的所有其他应用程序运行良好。但是当我右键单击它时,Eclipse 不会显示最近打开的项目。它也不允许将某些项目固定在其中。请注意,我有 Eclipse Helios 的 JS 版本。加载后会生成一个新的和不同的任务栏图标。
回答by whlk
Specify the latest available Java VM in your eclipse.ini
. I.e.:
在您的eclipse.ini
. IE:
-vm
jdk1.6.0_10\jre\bin\client\jvm.dll
- Make sure they are on separate lines
- Anything after the "vmargs" is taken to be vm arguments
- 确保它们在不同的行上
- "vmargs" 之后的任何内容都被视为 vm 参数
(更多信息)
Or alternatively add the java bin
folder to your Windows PATH
beforethe "windows32" folder, because otherwise eclipse uses "javaw.exe" in the win32 folder instead of the JDK one.
或者,在“windows32”文件夹之前将 javabin
文件夹添加到 Windows 中,否则 eclipse 将使用 win32 文件夹中的“javaw.exe”而不是 JDK 文件夹。PATH
回答by Jeff Axelrod
Riccardo's solutionfrom 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?
来自 Eclipse 错误报告的Riccardo解决方案对我有用,但我没有从任务栏中获得最近打开的项目等。有没有人遇到过这些变通方法可以恢复这种行为?
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
我在带有 Helios x64 的 Windows 7 x64 上遇到了同样的问题,但对我而言,以下解决方法适用于任务栏按钮的“始终合并、隐藏标签”选项。
- 检查指定 VM 的“eclipse.ini”并确保路径指向 JDK 或 JRE 的 bin 目录(而不是 javaw.exe)。对我来说,参数是没有引号的“D:/Development/Languages/Java/Development Kit/bin/”。
- 从任务栏中取消固定 Eclipse 或删除快捷方式
- 从资源管理器中运行“eclipse.exe”并选择您的工作区
- 加载启动画面后和显示主窗口时,将 Eclipse 固定到任务栏
回答by coder
setting eclipse.exe to compatibility mode works
将 eclipse.exe 设置为兼容模式有效
回答by Pieter van Niekerk
I just want to add this for the Win10 users.
我只想为Win10用户添加这个。
Edit eclipse.ini
to add these lines at the end before the line --launcher.appendVmargs:
编辑eclipse.ini
以在行前的末尾添加这些行--launcher.appendVmargs:
-vm
C:/Program Files/Java/jdk1.8.0/jre/bin/server/jvm.dll
-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.
您还需要设置与 Windows Vista 的兼容性才能使其正常工作。
回答by Campfire
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.
我认为值得一提的是,至少对我来说,在 eclipse.ini 中使用正斜杠添加到 vm 的路径很重要,即使我正在使用 Windows(即 7)。当我使用反斜杠时 Eclipse 没有启动。
回答by Epicurist
Recently Timo Kinnunenhas pinpointed the problem
最近Timo Kinnunen查明了这个问题
Edit eclipse.ini find the line:
编辑 eclipse.ini 找到这一行:
--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.
这会导致 JVM 在与 eclipse.exe 相同的进程中启动,而不是作为子进程启动,并避免了具有 AppUserModelID 的主机进程的复杂性。
And it works !!!
它有效!!!
回答by Tw Bert
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 heredoes provide a reference to the underlying System.AppUserModel.ID
property.
到目前为止,StackOverflow 上提供的解决方案没有一个简单的解决方案来运行多个 Eclipse,而每个 Eclipse 都有自己的 Eclipse Application ID
,并使图标分组按预期工作。这里的答案确实提供了对基础System.AppUserModel.ID
属性的引用。
Here's a quick HOWTO:
这是一个快速的HOWTO:
- Do the
-vm
setting as plenty of people here have mentioned - Run the eclipse app
- Right click on the running taskbar icon,
Pin this program to taskbar
- Navigate to
%AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\Taskbar
- Copy the newly created shortcut to another location. It will be named
eclipse
,eclipse (2)
, oreclipse (3)
and so on - Right click on the running taskbar icon,
Unpin this program from taskbar
- Use the Shortcut Properties dialog to copy all individual fields (target + parameters, workdir, icon, anything else) to the new shortcut
- Rename the new shortcut
- Drag the new shortcut to the Windows Taskbar
- Done
- 做
-vm
这里很多人提到的设置 - 运行日食应用
- 右键单击正在运行的任务栏图标,
Pin this program to taskbar
- 导航
%AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\Taskbar
- 将新创建的快捷方式复制到另一个位置。它将被命名为
eclipse
,eclipse (2)
, oreclipse (3)
等等 - 右键单击正在运行的任务栏图标,
Unpin this program from taskbar
- 使用“快捷方式属性”对话框将所有单个字段(目标 + 参数、工作目录、图标等)复制到新快捷方式
- 重命名新快捷方式
- 将新快捷方式拖到 Windows 任务栏
- 完毕
Here's an extended HOWTO, helpful if you want icon grouping separated per individual Eclipse instance (if you have multiple instances running):
这是一个扩展的HOWTO,如果您希望按单个 Eclipse 实例分隔图标分组(如果您有多个实例正在运行),则很有帮助:
- Find out what your startup plugin is, for example
org.eclipse.epp.package.java_2.0.1.20130919-0803
. Open theplugin.xml
file of that folder. - Edit the following XML location in that file:
/plugin/extension/product/property[@name="appName"]
, set attributevalue
to something else. Don't use spaces, keep length below (up until) 40. - Optionally also set the window title:
/plugin/extension/product/property[@name]
, set attributename
to something else. - 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. - Follow the quick HOWTOabove
- 例如,找出您的启动插件是什么
org.eclipse.epp.package.java_2.0.1.20130919-0803
。打开该plugin.xml
文件夹的文件。 - 编辑该文件中的以下 XML 位置:
/plugin/extension/product/property[@name="appName"]
,将属性设置value
为其他内容。不要使用空格,保持长度低于(直到)40。 - 也可以选择设置窗口标题:
/plugin/extension/product/property[@name]
,将属性设置name
为其他内容。 - 在现有的 Eclipse 快捷方式中,追加
-clean
并运行一次。您会注意到//product/property[@name]
Eclipse 窗口标题中使用的属性。之后,您可以-clean
再次删除。 - 按照上面的快速HOWTO
A quick explanation on What's going on here:
关于这里发生了什么的快速解释:
- 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.
- Windows groups by identical
System.AppUserModel.ID
property,AppID
for short - 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 theAppID
to the value inside aplugin.xml
file. See above: extended HOWTOitem 2 - 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. - When you start an Eclipse application, right click on the running taskbar icon,
Pin this program to taskbar
-> thenWindows will detect theAppID
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:- Do a file copy of the .lnk file and fill in the missing gaps yourself
- Or, use a shortcut creation tool that understands
System.AppUserModel.ID
properties (there are plenty) - Or, use the Windows API directly
- 在 .lnk 文件中,存储了一个属性,无法使用 windows 快捷方式属性对话框输入该属性。如果您复制 .lnk 文件,则属性将随之复制。
- Windows 按相同的
System.AppUserModel.ID
属性分组,AppID
简称 - Eclipse
AppID
在启动时没有。首先启动JVM,然后启动eclipse core/platform,然后加载启动插件。在最后一个阶段,将调用 API 以将 设置AppID
为plugin.xml
文件中的值。见上:扩展的HOWTO项目 2 - 当您将手动创建的快捷方式 .lnk 文件拖到任务栏时,Windows 无法将其
AppID
放入 .lnk 文件的新“固定”版本中是有道理的。它只能在运行时检测到。 - 当您启动 Eclipse 应用程序时,右键单击正在运行的任务栏图标,
Pin this program to taskbar
->然后Windows 将检测到AppID
并将其存储在“固定”.lnk 中。但是,部分由于 JVM 进程重定向,Windows 不会检测命令行参数、环境、工作文件夹(至少在启动时)和图标路径 + 图标索引。所以你必须:- 做一个.lnk文件的文件副本,自己填补缺失的空白
- 或者,使用理解
System.AppUserModel.ID
属性的快捷方式创建工具(有很多) - 或者,直接使用 Windows API
Sincerely hope this will reduce the amount of haywire Eclipse taskbars icons on the workstations around me,
真诚地希望这会减少我周围工作站上杂乱无章的 Eclipse 任务栏图标的数量,
Cheers, TW
干杯,台湾