1

I am using EGit in Eclipse for a Gradle build. Because the Gradle configuration breaks when I clone to a different folder, I simply selected an already populated folder to create a new repository. When pushing to remote, I receive this error:

Transport Error: Cannot get remote repository refs.
Cannot run program "C:\Program Files (x86)\Git\bin":
    CreateProcess error=5, Access is denied

Most likely, the reference should be to git.exe and not its path, but I have not been able to find a way to configure this in Eclipse. The errors cascade:

org.eclipse.jgit.api.errors.TransportException: Cannot run program "C:\Program Files (x86)\Git\bin": CreateProcess error=5, Access is denied
at org.eclipse.jgit.api.LsRemoteCommand.execute(LsRemoteCommand.java:223)
at org.eclipse.jgit.api.LsRemoteCommand.call(LsRemoteCommand.java:159)
at org.eclipse.egit.core.op.ListRemoteOperation.run(ListRemoteOperation.java:99)
at org.eclipse.egit.ui.internal.components.RefSpecPage$3.run(RefSpecPage.java:250)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)

Caused by: org.eclipse.jgit.errors.TransportException: Cannot run program "C:\Program Files (x86)\Git\bin": CreateProcess error=5, Access is denied
at org.eclipse.jgit.transport.TransportGitSsh$ExtSession.exec(TransportGitSsh.java:245)
at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:262)
at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:161)
at org.eclipse.jgit.api.LsRemoteCommand.execute(LsRemoteCommand.java:202)
... 4 more

Caused by: java.io.IOException: Cannot run program "C:\Program Files (x86)\Git\bin": CreateProcess error=5, Access is denied
at java.lang.ProcessBuilder.start(Unknown Source)
at org.eclipse.jgit.transport.TransportGitSsh$ExtSession.exec(TransportGitSsh.java:243)
... 7 more

Caused by: java.io.IOException: CreateProcess error=5, Access is denied
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 9 more

Previously I had this warning, but somehow I was able to fix it:

Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level...

I have checked that I have read/write access to the Git binary and tried running Eclipse as admin. According to the EGit wiki the Team>Git>Configuration/System settings path should be set to path "C:\Program Files(x86)\Git".

How do I set the reference to git.exe and not the folder?


EDIT:

There is also an error in Eclipse:

FrameworkEvent ERROR

org.osgi.framework.BundleException: Could not resolve module: org.eclipse.egit.ui [117]
  Another singleton bundle selected: osgi.identity; osgi.identity="org.eclipse.egit.ui"; type="osgi.bundle"; version:Version="3.7.0.201502260915-r"; singleton:="true"

at org.eclipse.osgi.container.Module.start(Module.java:434)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1561)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)

Tried solutions:

  1. Scrubbing the path and setting it to the minimal Eclipse dependency while including a Git path: C:\ProgramData\Oracle\Java\javapath;C:\Git\bin

My Specs

Intel Core i7-3635QM CPU @ 2.40 GHz—12 GB RAM

Windows 8.1 (64-bit)

Eclipse Luna (build 4.4.2.M20150204-1700)

JAVA v 1.8.0_25

BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_GB
Framework arguments:  -product org.eclipse.epp.package.java.product
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product
org.eclipse.epp.package.java.product
noumenal
  • 1,077
  • 2
  • 16
  • 36

1 Answers1

1

Team>Git>Configuration/System is supposed to be a folder (for the system wide configuration).

As mentioned in this thread:

In FS_Win32.java JGit tries to find native git by running the command "which git" in a bash.
If native git isn't installed or bash or git aren't on the PATH then this command fails. JGit logs an error to leave a trace that this attempt to find native git failed but will work ok anyway.

JGit tries to find native git in order to locate the system wide git configuration which is located in a path relative to the native git installation.
If it doesn't find a native git installation JGit can't locate this system wide git configuration and hence will ignore it.

Try and unzip a Git for Windows in a simple path, and add that to your %PATH% (in first place for testing).
Try with:


Regarding the framework error:

org.osgi.framework.BundleException: Could not resolve module: org.eclipse.egit.ui [117]
  Another singleton bundle selected: osgi.identity; osgi.identity="org.eclipse.egit.ui"; type="osgi.bundle"; version:Version="3.7.0.201502260915-r"; singleton:="true"

The answer to "Egit is installed (came with Juno), but does not show at all" mentions:

Starting eclipse with the -clean command line option fixed the problem for me.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • This is a great answer! Pointing to the new Git did not work, but the old one did! However, I still have the error with the old path showing up: "C:\Program Files(x86)..." – noumenal Apr 18 '15 at 10:22
  • 1
    @noumenal Try and clean your `%PATH%` (just for testing) in order to have only the minimum (like `C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Git1.9.5\bin`) – VonC Apr 18 '15 at 10:24
  • Good idea! I was thinking the same, thanks to you pointing to the source code. Actually, there was no reference to Git in path. – noumenal Apr 18 '15 at 10:28
  • Scrubbing the path with "path;" had no effect after restarting Eclipse. I also forgot to tell you that I have a FrameworkEvent ERROR. – noumenal Apr 18 '15 at 10:35
  • 1
    @noumenal you can scrub that PATH locally in a CMD console, and start eclipse directly from that same console. That allows for many test with different PATH. What is the FrameworkEvent Error? What Windows are you using? With which Eclipse? And which JDK? – VonC Apr 18 '15 at 10:37
  • @noumenal can you try starting eclipse with the `-clean` option (again just for testing, as in http://stackoverflow.com/a/28767938/6309) – VonC Apr 18 '15 at 10:55
  • @noumenal also make sure the all stack is 64bits only (Eclipse 64bits, JDK 64bits) – VonC Apr 18 '15 at 10:58
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/75576/discussion-between-noumenal-and-vonc). – noumenal Apr 18 '15 at 10:59