如何正确设置Eclipse的Mercurial插件?

时间:2009-09-30 06:48:18

标签: eclipse mercurial eclipse-plugin

刚刚向Eclipse添加了Mercurial插件(1.4.12.86)(Web Dev Version,Build id:20090920-1017),并在启动时遇到此错误:

Cannot run program "hg": CreateProcess error=2, The system cannot find the file specified

找到thread on the same problem,但不知道如何修复它。

以下是日志中的更多内容:

!SUBENTRY 1 com.vectrace.MercurialEclipse 4 -100 2009-09-29 22:41:09.150
!MESSAGE Cannot run program "hg": CreateProcess error=2, The system cannot find the file specified
!STACK 0
java.io.IOException: Cannot run program "hg": CreateProcess error=2, The system cannot find the file specified
    at java.lang.ProcessBuilder.start(Unknown Source)
    at com.vectrace.MercurialEclipse.commands.AbstractShellCommand.executeToStream(AbstractShellCommand.java:191)
    at com.vectrace.MercurialEclipse.commands.AbstractShellCommand.executeToBytes(AbstractShellCommand.java:139)
    at com.vectrace.MercurialEclipse.commands.AbstractShellCommand.executeToBytes(AbstractShellCommand.java:126)
    at com.vectrace.MercurialEclipse.commands.HgDebugInstallClient.debugInstall(HgDebugInstallClient.java:24)
    at com.vectrace.MercurialEclipse.MercurialEclipsePlugin.checkHgInstallation(MercurialEclipsePlugin.java:117)
    at com.vectrace.MercurialEclipse.preferences.GeneralPreferencePage$LabelDecoratorRadioGroupFieldEditor.doStore(GeneralPreferencePage.java:55)
    at org.eclipse.jface.preference.FieldEditor.store(FieldEditor.java:680)
    at org.eclipse.jface.preference.FieldEditorPreferencePage.performOk(FieldEditorPreferencePage.java:343)
    at org.eclipse.jface.preference.PreferencePage.performApply(PreferencePage.java:432)
    at org.eclipse.jface.preference.PreferencePage$2.widgetSelected(PreferencePage.java:281)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:228)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3880)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3473)
    at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
    at org.eclipse.jface.window.Window.open(Window.java:801)
    at org.eclipse.ui.internal.dialogs.WorkbenchPreferenceDialog.open(WorkbenchPreferenceDialog.java:211)
    at org.eclipse.ui.internal.OpenPreferencesAction.run(OpenPreferencesAction.java:65)
    at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
    at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
    at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
    at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3880)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3473)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
    at java.lang.ProcessImpl.create(Native Method)
    at java.lang.ProcessImpl.<init>(Unknown Source)
    at java.lang.ProcessImpl.start(Unknown Source)

3 个答案:

答案 0 :(得分:11)

你在本地安装了mercurial吗?即。你能从命令行/ dos框运行hg吗?如果没有,你需要从那开始 - 从Mercurial网站获取它。

答案 1 :(得分:3)

您可能在Windows上本地安装了mercurial,但是自安装以来还没有重新启动Windows。重新启动后,eclipse插件将能够找到mercurial安装。

答案 2 :(得分:1)

实际上,并不完全。 Eclipse Mercurial插件要求您安装hg命令行实用程序,它们是python程序。这意味着你必须安装python(最低2.6)。这意味着Eclipse将执行Python脚本时遇到问题,直到您执行Eclipse理解的程序(如DOS批处理脚本)执行hg python脚本。

然后,毕竟,也许你最终能够检查出来的东西(复制,克隆他们在Mercurial世界中称之为的东西)。