gradle-wrapper.properties not found after clean install intellij idea 2020.1.2 community edition on windows 10

Viewed 13092

Installed clean windows10(1607) and intellij idea(2020.1.2 community edition). When i create new gradle project

Invalid Gradle JDK configuration found. Open Gradle Settings

"gradle-wrapper.properties not found".

How can I fix it? enter image description here

4 Answers

Install gradle 6.7

sdk install gradle 6.7 brew install gradle

Go to IntelliJ and set gradle version:

On File >> Settings >> Build, Execution , Deployment >> Gradle

or

Preferences >> Gradle

In Use Gradke from specific the correct location

enter image description here

If IDEA is set to use the Gradle wrapper (as it is in your screenshot: "Use Gradle from:" is set to "gradle-wrapper.properties"), IDEA expects the following file structure:

  • Gradle wrapper JAR: [project root]/gradle/wrapper/gradle-wrapper.jar
  • Gradle wrapper properties: [project root]/gradle/wrapper/gradle-wrapper.properties
  • Gradle wrapper script: [project root]/gradlew.bat

If you are missing one of these three elements, IDEA will attempt to generate the wrapper by calling the gradle wrapper task. It will do this using the Gradle JDK, which may or may not be the project SDK (File > Settings > Build, Execution, Deployment > Build Tools > Gradle > Gradle JVM).

I'm not sure how it selects the version of Gradle it uses - I only have 6.8.3 installed on my machine, and I had my wrapper properties set to 7.0-rc-1, yet somehow it used 6.7.0 when generating the wrapper.

I tried various options for clearing the cache, but did not get the result. Openjdk-14 installed by default and does not work. From site adoptopenjdk.net install OpenJDK 11 (LTS). When creating the project, I chose 11 version. Then the program suggested updating gradle to version 6 and it worked.

I ran into this problem a while ago when I upgraded to intellij 2020.* The first time I created a new project there was no problem: gradle daemon did its work and the project was created with no problems.

In my case, the project would start a new gradle daemon, and attempt to build the project, would get rejected by windows Security, and nothing would happen, so intellij goes ahead and starts another (unsuccessful) daemon. Soon, I had 20+ gradle daemon processes running on my system, all of them doing nothing.

So, it looks like intellij has messed in enabling that it places the appropriate permissions it requires for these folders that it depends on to run properly. So, you need to manually give these permissions, and then things (should) work.

The real issue here is security on your machine: either a virus checker or the security software, Windows Security on Windows 10, for example. The first time you make a project, Intellij goes and produces a number of folders that they need access to.

However, once these folders are available, for whatever, intellij doesn't make sure to give itself access.

On windows 10, in AppData, you'll find several folders required by Intellij to produce, in my case, produce gradle projects.

Try finding the various folders that Intellij has produced on your system, and give them exceptions on your virus checker and on whatever firewall/security software programs that may block access.

Related