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:
- 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