4

I am trying to use mercurial in eclipse. I downloaded mercurial eclipse plugin for this.
But, despite I had reinstalled it many times, it gives the same error, I put the screenshot below.

Mercurial for Eclipse error message

Checking encoding (cp1254)...
Checking extensions...
Checking templates...
Checking patch...
Checking commit editor...
 Can't find editor 'notepad' in PATH
 (specify a commit editor in your configuration file)
Checking username...
1 problems detected, please check your install!. Command line: hg -y debuginstall

I do not know how to handle this. Any help will be appreciated very much, thank you.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
emre
  • 239
  • 2
  • 5
  • 13
  • Looks like you should go to a command line and type `hg -y debuginstall` – Tyler Feb 14 '11 at 07:18
  • It gives exactly the same result, "Can't find editor 'notepad' in PATH (specify a commit editor in your configuration file)". – emre Feb 14 '11 at 07:38

5 Answers5

7

I encountered the same problem when I tried to run Eclipse x64 on Win 7 x64. The MercurialEclipse seems not able to access C:\windows\system32\ folder, although it has been specified in system PATH. You need to specify the location of editor in the Mercurial.ini file. This file is located at c:\Users\<your_username>\mercurial.ini.

Under the username = ... line, add a line to specify the editor (see following). Remember not to put quotes around the path.

[ui]
username = <username>
editor = c:\Windows\System32\notepad.exe
superjos
  • 12,189
  • 6
  • 89
  • 134
Qinjie
  • 1,786
  • 2
  • 19
  • 32
6

(Note: similar to bug 13505 in Mercurial Eclipse project)

The Eclipse inherits the path from your current session.
Open a DOS session, and check if said session does have notepad in its path (which it should considering notepad is in C:\Windows\system32\notepad.exe). Make sure C:\Windows\system32 (or %SystemRoot%\system32) is in first position in your PATH (in case of side effect with other paths with spaces or special characters in it).
If the path is correct, then launch the eclipse from that command-line DOS windows, and see if the problem persists.


The OP emre reports its %PATH% being:

C:\Program Files\NVIDIA Corporation\PhysX\Common;
C:\Program Files\Java\jdk1.6.0_20\bin;
D:\eclipse-java-helios-sr1-win32\eclipse\android-2.2_r0-windows\android-2.2_r0-windows\tools;
C:\Program Files\Java\jdk1.6.0_20\bin

In other word, no %SystemRoot%\system32.

You need to edit the System variables in the Environment variable settings of Windows, and add in the first place in the PATH variable:

%SystemRoot%\system32

Then you can open a new DOS session, launch eclipse from there and ot should work fine.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • notepad.exe exists at C:\Windows\system32\notepad.exe, i checked. But it is still not working. I do not understand why i get this error. – emre Feb 14 '11 at 15:43
  • @emre: probably because the `%PATH%` is somehow modified when you launch Eclipse. How do you launch it, by the way? `eclipse.exe` directly or through some kind of script? – VonC Feb 14 '11 at 15:49
  • I opened it directly. How could path be modified when i launch eclipse? By the way, i located eclipse files in D:/ drive, then i moved it to C:/ drive and tried again, result did not change. – emre Feb 14 '11 at 15:53
  • @emre: could you type "`echo %PATH%`" in a DOS windows, to see what your `PATH` look like? – VonC Feb 14 '11 at 16:09
  • %c:/windows/system32/notepad.exe% returned. – emre Feb 14 '11 at 16:45
  • @emre: strange, that doesn't look like what `echo %PATH%` should return. Did you type `echo %PATH%` ? – VonC Feb 14 '11 at 16:54
  • I put the screenshot below, thank you for your help. http://img25.imageshack.us/img25/3481/questioni.png – emre Feb 14 '11 at 19:40
  • @emre: I did see your screenshot, but I would like you to type `echo %PATH%`, not `echo %c:\...%` – VonC Feb 14 '11 at 19:56
  • I am sorry, it was my fault. Here is new screenshot. http://img11.imageshack.us/img11/5273/questionm.png – emre Feb 14 '11 at 20:13
  • 1
    @emre: that is what I thought: no `c:\Windows\system32` in sight. You need to add that particular path to your `PATH` environment variable (in the System variable part): see http://vlaurie.com/computers2/Articles/environment.htm – VonC Feb 14 '11 at 21:26
  • I overcame it finally, with your useful and precious helps. Thank you so much ! – emre Feb 14 '11 at 22:07
  • @VonC, I have exactly the same problem, and added `%SystemRoot%\system32` to my `System Variable` path, but still no effect. Could you please take a look over my screenshot PATH's output, and maybe you see what is wrong: http://img844.imageshack.us/img844/4255/47072205.png ? – Andy Res Sep 25 '12 at 20:28
  • @AndyRes all I can see at first glance is a suspicious space between a ';' and a C:\...Powershell: can you remove it and see, in a *new* DOS session, if the issue persists? – VonC Sep 25 '12 at 21:36
  • 1
    By the way, although TortoiseHg seems happy with the mercurial.ini editor variable having a value enclosed in quotes, command-line hg and MercurialEclipse seem not to be. It fixed things for me to remove the enclosing quotes around C:/Windows/system32/notepad.exe – Matt Passell Dec 17 '12 at 17:15
2

i had the same problem and searched for hours till i tried to escape the backslash in the path for the editor. so i edited the mercurial.ini (on my win7) like this:

[ui]
username = <username>
editor = c:\\Windows\\System32\\notepad.exe

and it worked.

midda
  • 21
  • 1
0

Three additions:

  • It seems that Tortoise HG 3.3 configuration utility added my editor setting to [tortoisehg] section rather than the [ui] section of mercurial.ini For Eclipse Mercurial to work, the editor path must also be in the [ui] section. Otherwise, eclipse will have this error.
  • using forward slash suitably substitutes for the escaped backslash
  • On Windows 8.1, notepad easily starts from the command prompt (on system path) and yet the error above still occurs. In my hands the general system path advice given above seems off target
Rob Baer
  • 39
  • 4
0

One other thing to look at is the HGEDITOR environment variable, which overrides the editor setting in mercurial.ini. I had HGEDITOR set to C:\Windows\System32\notepad.exe, which didn't work (due to the unescaped backslashes), and all my changes to mercurial.ini were ignored. Changing HGEDITOR to C:\\Windows\\System32\\notepad.exe finally got rid of the Mercurial Eclipse errors.

the klaus
  • 81
  • 2
  • 5