title: How to setup gradle with Intellij IDEA with WSL2 project?
body: <p>I have a project cloned inside <a href="https://ubuntu.com/wsl" rel="noreferrer">ubuntu wsl</a> <code>\\wsl$\Ubuntu\home\username\project</code>. Opened it inside Intellij IDEA Ultimate 2020.1.3 and tried to import as gradle project, but I am getting uninformative error message: <a href="https://i.stack.imgur.com/ENwJT.png" rel="noreferrer"><img src="https://i.stack.imgur.com/ENwJT.png" alt="enter image description here" /></a></p>
  <p>Here's my gradle config in IDEA:
  <a href="https://i.stack.imgur.com/H5iFd.png" rel="noreferrer"><img src="https://i.stack.imgur.com/H5iFd.png" alt="enter image description here" /></a></p>
  <p>The question is how should I open my project in IDEA then?</p>
  <p><strong>EDIT:</strong></p>
  <p>Logs from imported project contain this stack trace. Possibly this causes the issue.</p>
  <pre><code>org.gradle.tooling.GradleConnectionException: Could not install Gradle distribution from 'https://services.gradle.org/distributions/gradle-6.5.1-all.zip'.
      at org.gradle.tooling.internal.consumer.DistributionFactory$ZippedDistribution.getToolingImplementationClasspath(DistributionFactory.java:139)
      at org.jetbrains.plugins.gradle.GradleConnectorService$DistributionWrapper.getToolingImplementationClasspath(GradleConnectorService.kt:287)
      at org.gradle.tooling.internal.consumer.loader.CachingToolingImplementationLoader.create(CachingToolingImplementationLoader.java:41)
      at org.gradle.tooling.internal.consumer.loader.SynchronizedToolingImplementationLoader.create(SynchronizedToolingImplementationLoader.java:44)
      at org.gradle.tooling.internal.consumer.connection.LazyConsumerActionExecutor.onStartAction(LazyConsumerActionExecutor.java:147)
      at org.gradle.tooling.internal.consumer.connection.LazyConsumerActionExecutor.run(LazyConsumerActionExecutor.java:129)
      at org.gradle.tooling.internal.consumer.connection.CancellableConsumerActionExecutor.run(CancellableConsumerActionExecutor.java:45)
      at org.gradle.tooling.internal.consumer.connection.ProgressLoggingConsumerActionExecutor.run(ProgressLoggingConsumerActionExecutor.java:61)
      at org.gradle.tooling.internal.consumer.connection.RethrowingErrorsConsumerActionExecutor.run(RethrowingErrorsConsumerActionExecutor.java:38)
      at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor.lambda$run$0(DefaultAsyncConsumerActionExecutor.java:62)
      at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
      at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
      at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
      at java.base/java.lang.Thread.run(Thread.java:834)
  Caused by: java.io.IOException: Incorrect function
      at java.base/sun.nio.ch.FileDispatcherImpl.lock0(Native Method)
      at java.base/sun.nio.ch.FileDispatcherImpl.lock(FileDispatcherImpl.java:100)
      at java.base/sun.nio.ch.FileChannelImpl.tryLock(FileChannelImpl.java:1161)
      at java.base/java.nio.channels.FileChannel.tryLock(FileChannel.java:1165)
      at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:55)
      at org.gradle.wrapper.Install.createDist(Install.java:48)
      at org.gradle.tooling.internal.consumer.DistributionInstaller.install(DistributionInstaller.java:72)
      at org.gradle.tooling.internal.consumer.DistributionFactory$ZippedDistribution.getToolingImplementationClasspath(DistributionFactory.java:133)
      ... 15 more
  </code></pre>
  <p><strong>EDIT2:</strong>
  Attaching full logs of instantiating new project with <code>gradle init</code> command:
  <a href="https://pastebin.com/G4xhR3N3" rel="noreferrer">https://pastebin.com/G4xhR3N3</a></p>