vscode-java: Could not fetch model of type 'GradleProject' using Gradle distribution 'https://services.gradle.org/distributions/gradle-7.2-bin.zip'

When I tried to open build.gradle, normally it will just build it for me, but it returned with this error: Could not fetch model of type 'GradleProject' using Gradle distribution 'https://services.gradle.org/distributions/gradle-7.2-bin.zip'

Environment
  • Operating System: Windows 10
  • JDK version: 16.0.2
  • Visual Studio Code version: 1.61.2
  • Java extension version: 1.1.0
Steps To Reproduce
  1. opening build.gradle
Current Result
CONFIGURE FAILED in 14s
[error] [gradle-server] Could not fetch model of type 'GradleProject' using Gradle distribution 'https://services.gradle.org/distributions/gradle-7.2-bin.zip'.
[error] Error getting build for c:\Users\meee\OneDrive\Desktop\fabric-example-mod: Could not fetch model of type 'GradleProject' using Gradle distribution 'https://services.gradle.org/distributions/gradle-7.2-bin.zip'.
[info] Found 0 tasks

(this is part of the question I posted on StackOverflow: https://stackoverflow.com/questions/69591576/vscode-could-not-fetch-model-of-type-gradleproject-using-gradle-distribution)

Expected Result

build the project

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 27 (17 by maintainers)

Most upvoted comments

C:\Users\meee.tooling\gradle\

C:\Users\meee\.cache\tooling\

Hi, I already configured java.home to JDK 16.0.2, then I tried setting java.import.gradle.java.home to JDK 16.0.2, and also restarted vscode, but it still returned with the same error.

@orange2222222222 Could you try to set the following property?

"java.configuration.runtimes": [

        {
            "name": "JavaSE-16",
            "path": "C:\\Program Files\\Java\\jdk-16.0.2",
            "default": true
        }
]

The issue is reproducible if you’re using JDK < 16 for running the Gradle daemon

@0dinD I have seen it, but it is another issue. I can’t reproduce the following error:

Could not fetch model of type ‘GradleProject’ using Gradle distribution…

This error can be caused by an invalid gradle distribution in ~/.cache/tooling or ~/.gradle/wrapper/dists