roman m
roman m

Reputation: 26531

How to properly setup Mercurial plugin for Eclipse?

Just added Mercurial plugin (1.4.12.86) to Eclipse (Web Dev Version, Build id:20090920-1017), and got this error on startup:

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

Found a thread on the same problem, but have no idea how to fix it.

Here's more from the log:

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

Upvotes: 7

Views: 10000

Answers (3)

Ellayararwhy
Ellayararwhy

Reputation: 11

Actually, not quite. The Eclipse Mercurial plug in requires you to install the hg command line utilities, which are python programs. That means you have to install python (2.6 minimum). That means that Eclipse will have problems executing a Python script until you have it execute a program that Eclipse understands (like a DOS batch script) that executes the hg python script.

Then after all ofthat, perhaps you will eventually be able to check stuff out (copy, clone whatever they call it in the Mercurial world).

Upvotes: 1

olamundo
olamundo

Reputation: 24981

You might have mercurial installed locally on windows, but have yet to restart windows since you installed. After you reboot the eclipse plugin will be able to find the mercurial installation.

Upvotes: 3

Szemere
Szemere

Reputation: 188

Do you have mercurial installed locally? ie. can you run hg from the command line/dos box? If not, you need to start with that - get it from the Mercurial website.

Upvotes: 11

Related Questions