title: How do I fix an OverlappingFileLockException when building with Gradle on Windows?
body: <p>Upon attempting to walk through the <a href="http://spring.io/guides/tutorials/rest/" rel="nofollow">Spring REST tutorial</a>, which uses Gradle, I encountered an OverlappingFileLockException when trying to run <code>./gradlew clean test</code>. When I tried to use a full installation of Gradle instead of the included wrapper, I would get the same exception. So, I decided to start much more simply, and follow Gradle's own <a href="http://www.gradle.org/docs/current/userguide/tutorial_using_tasks.html" rel="nofollow">Hello World example</a>, with the same result. Here is the stacktrace:</p>
  
  <pre><code>FAILURE: Build failed with an exception.
  
  * What went wrong:
  A problem occurred configuring root project 'hello-world'.
  &gt; Could not open no_buildscript class cache for build file 'D:\gradle-playground\hello-world\build.gradle' (\\omafp01.co
  rp.planetci.com\ramc01\.gradle\caches\1.11\scripts\build_5trnq1oe4m84o6rmggev8gku4t\ProjectScript\no_buildscript).
     &gt; java.nio.channels.OverlappingFileLockException (no error message)
  
  * Try:
  Run with --info or --debug option to get more log output.
  
  * Exception is:
  org.gradle.api.ProjectConfigurationException: A problem occurred configuring root project 'hello-world'.
          at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.
  java:79)
          at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:57)
          at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:507)
          at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:82)
          at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:31)
          at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:142)
          at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:113)
          at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:81)
          at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter
  .java:64)
          at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
          at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
          at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:35)
          at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
          at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)
          at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:171)
          at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:20
  1)
          at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:17
  4)
          at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:170)
          at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:139)
          at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
          at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
          at org.gradle.launcher.Main.doAction(Main.java:46)
          at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
          at org.gradle.launcher.Main.main(Main.java:37)
          at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50)
          at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32)
          at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
  Caused by: org.gradle.cache.CacheOpenException: Could not open no_buildscript class cache for build file 'D:\gradle-play
  ground\hello-world\build.gradle' (\\omafp01.corp.planetci.com\ramc01\.gradle\caches\1.11\scripts\build_5trnq1oe4m84o6rmg
  gev8gku4t\ProjectScript\no_buildscript).
          at org.gradle.cache.internal.DefaultPersistentDirectoryStore.open(DefaultPersistentDirectoryStore.java:48)
          at org.gradle.cache.internal.DefaultPersistentDirectoryStore.open(DefaultPersistentDirectoryStore.java:28)
          at org.gradle.cache.internal.DefaultCacheFactory.doOpen(DefaultCacheFactory.java:81)
          at org.gradle.cache.internal.DefaultCacheFactory.open(DefaultCacheFactory.java:51)
          at org.gradle.cache.internal.DefaultCacheRepository$PersistentCacheBuilder.doOpen(DefaultCacheRepository.java:14
  1)
          at org.gradle.cache.internal.DefaultCacheRepository$AbstractCacheBuilder.open(DefaultCacheRepository.java:124)
          at org.gradle.groovy.scripts.internal.FileCacheBackedScriptClassCompiler.compile(FileCacheBackedScriptClassCompi
  ler.java:57)
          at org.gradle.groovy.scripts.internal.ShortCircuitEmptyScriptCompiler.compile(ShortCircuitEmptyScriptCompiler.ja
  va:35)
          at org.gradle.groovy.scripts.internal.CachingScriptClassCompiler.compile(CachingScriptClassCompiler.java:36)
          at org.gradle.groovy.scripts.DefaultScriptCompilerFactory$ScriptCompilerImpl.compile(DefaultScriptCompilerFactor
  y.java:57)
          at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:17
  1)
          at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:38)
          at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:25)
          at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.j
  ava:34)
          at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:55)
          ... 25 more
  Caused by: java.nio.channels.OverlappingFileLockException
          at org.gradle.cache.internal.filelock.LockStateAccess.tryLock(LockStateAccess.java:83)
          at org.gradle.cache.internal.filelock.LockFileAccess.tryLockState(LockFileAccess.java:83)
          at org.gradle.cache.internal.DefaultFileLockManager$DefaultFileLock.lockStateRegion(DefaultFileLockManager.java:
  312)
          at org.gradle.cache.internal.DefaultFileLockManager$DefaultFileLock.lock(DefaultFileLockManager.java:255)
          at org.gradle.cache.internal.DefaultFileLockManager$DefaultFileLock.&lt;init&gt;(DefaultFileLockManager.java:127)
          at org.gradle.cache.internal.DefaultFileLockManager.lock(DefaultFileLockManager.java:80)
          at org.gradle.cache.internal.DefaultFileLockManager.lock(DefaultFileLockManager.java:67)
          at org.gradle.cache.internal.DefaultCacheAccess.open(DefaultCacheAccess.java:86)
          at org.gradle.cache.internal.DefaultPersistentDirectoryStore.open(DefaultPersistentDirectoryStore.java:46)
          ... 39 more
  </code></pre>
  
  <p>Here are the contents of <code>build.gradle</code>:</p>
  
  <pre><code>task hello {
      doLast {
          println 'Hello world!'
      }
  }
  </code></pre>
  
  <p>I am running Windows 8, a 64-bit JDK (1.6_043), and Gradle 1.11 while connected to a VPN. Of course, this works fine on my Macbook, but I need to get it working on my work machine.</p>