title: Cannot run Gradlew: get Exception in thread "main" java.net.SocketException: Connection reset
body: <p>I'm trying to run gradlew to build some code that had been supplied to me.  The source is the ZIP download from <a href="https://github.com/SpringSource/spring-security-saml" rel="nofollow noreferrer">here</a> and all I've done is open a command prompt, cd to that folder and run gradlew.bat.</p>
  
  <p>I've had this work on my crash'n'burn machine but I can't get it working on my main dev machine.  The dev machine sits behind a proxy which requires authentication, the other machine doesn't - they're at different locations.</p>
  
  <p>Originally, I got: </p>
  
  <pre><code>Exception in thread "main" java.net.UnknownHostException: services.gradle.org
  </code></pre>
  
  <p>From <a href="https://stackoverflow.com/questions/8938994/gradlew-behind-a-proxy">this</a>, to gradle.properties, I added:</p>
  
  <pre><code>systemProp.http.proxyHost=192.168.x.y 
  systemProp.http.proxyPort=80
  systemProp.http.proxyUser=myuserid
  systemProp.http.proxyPassword=mypassword
  </code></pre>
  
  <p>and ran it again and got:</p>
  
  <pre><code>C:\Users\tso259sa\workspace\spring-security-saml-master&gt;gradlew.bat
  Downloading http://services.gradle.org/distributions/gradle-1.4-bin.zip
  
  Exception in thread "main" java.net.SocketException: Connection reset
      at java.net.SocketInputStream.read(SocketInputStream.java:189)
      at java.net.SocketInputStream.read(SocketInputStream.java:121)
      at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
      at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)
      at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
      at sun.net.www.MeteredStream.read(MeteredStream.java:134)
      at java.io.FilterInputStream.read(FilterInputStream.java:133)
      at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:3052)
      at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:3046)
      at org.gradle.wrapper.Download.downloadInternal(Download.java:67)
      at org.gradle.wrapper.Download.download(Download.java:49)
      at org.gradle.wrapper.Install.createDist(Install.java:51)
      at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
      at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
  </code></pre>
  
  <p>For info, if I try an incorrect password or ID, I get:</p>
  
  <pre><code>Exception in thread "main" java.net.ProtocolException: Server redirected too many  times (20)
  </code></pre>
  
  <p>so I think that rules out incorrect ID.  Anyone have any ideas what I can try?</p>