title: Access Denied During EGit Push: How do I set the reference to exe and not folder?
body: <p>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:</p>
  
  <pre><code>Transport Error: Cannot get remote repository refs.
  Cannot run program "C:\Program Files (x86)\Git\bin":
      CreateProcess error=5, Access is denied
  </code></pre>
  
  <p>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:</p>
  
  <pre><code>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.&lt;init&gt;(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.&lt;init&gt;(Unknown Source)
  at java.lang.ProcessImpl.start(Unknown Source)
  ... 9 more
  </code></pre>
  
  <p>Previously I had this warning, but somehow I was able to fix it:</p>
  
  <pre><code>Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level...
  </code></pre>
  
  <p>I have checked that I have read/write access to the Git binary and tried running Eclipse as admin. According to <a href="https://wiki.eclipse.org/EGit/User_Guide#Pointing_out_the_System_wide_configuration" rel="nofollow" title="the EGit Wiki">the EGit wiki</a> the Team>Git>Configuration/System settings path should be set to path "C:\Program Files(x86)\Git".</p>
  
  <p>How do I set the reference to git.exe and not the folder?</p>
  
  <hr>
  
  <p><strong>EDIT:</strong></p>
  
  <p>There is also an error in Eclipse:</p>
  
  <p>FrameworkEvent ERROR</p>
  
  <pre><code>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)
  </code></pre>
  
  <p>Tried solutions:</p>
  
  <ol>
  <li>Scrubbing the path and setting it to the minimal Eclipse dependency while including a Git path: C:\ProgramData\Oracle\Java\javapath;C:\Git\bin</li>
  </ol>
  
  <hr>
  
  <p><strong>My Specs</strong></p>
  
  <p>Intel Core i7-3635QM CPU @ 2.40 GHz—12 GB RAM</p>
  
  <p>Windows 8.1 (64-bit)</p>
  
  <p>Eclipse Luna (build 4.4.2.M20150204-1700)</p>
  
  <p>JAVA v 1.8.0_25</p>
  
  <pre><code>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
  </code></pre>